Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public async Task <ActionResult <int> > Create(CreateThingsDescCommand command)
 {
     return(await Mediator.Send(command));
 }