Skip to content

Commit

Permalink
test deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Mar 18, 2024
1 parent 64bc87b commit b9ce1ad
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions output/csharp/src/Seam.Test/Client/SeamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,40 @@ public void Test()
{
Assert.Throws<SeamException>(() => seam.AccessCodes.Get(accessCodeId: "nonexistent"));
}

[Fact]
public void TestDelete()
{
var device = seam.Devices
.List()
.First(d => d.DeviceType == Device.DeviceTypeEnum.AugustLock);

Assert.NotNull(device);

seam.Devices.Delete(deviceId: device.DeviceId);

var device2 = seam.Devices
.List()
.First(d => d.DeviceType == Device.DeviceTypeEnum.AugustLock);

Assert.NotEqual(device.DeviceId, device2.DeviceId);
}

[Fact]
public async void TestDeleteAsync()
{
var device = (await seam.Devices.ListAsync()).First(
d => d.DeviceType == Device.DeviceTypeEnum.AugustLock
);

Assert.NotNull(device);

await seam.Devices.DeleteAsync(deviceId: device.DeviceId);

var device2 = (await seam.Devices.ListAsync()).First(
d => d.DeviceType == Device.DeviceTypeEnum.AugustLock
);

Assert.NotEqual(device.DeviceId, device2.DeviceId);
}
}

0 comments on commit b9ce1ad

Please sign in to comment.