public async Task ShouldCreateDeviceItem() { var thingsDesc = new CreateThingsDescCommand { Name = "HUE Dim Light", Value = "test" }; await SendAsync(thingsDesc); var userId = await RunAsDefaultUserAsync(); var device = new CreateDeviceItemCommand { Name = "New Devices", ThingsDescId = 1 }; var deviceId = await SendAsync(device); var item = await FindAsync <Sensor>(deviceId); item.Should().NotBeNull(); item.Name.Should().Be(device.Name); item.CreatedBy.Should().Be(userId); item.LastModifiedBy.Should().BeNull(); item.LastModified.Should().BeNull(); }
public async Task <ActionResult <int> > Create(CreateThingsDescCommand command) { return(await Mediator.Send(command)); }