public async Task Should_Add_A_Device() { var consumerController = new ConsumersController(fixture.GetDataProvider()); var consumer = (await consumerController.AddConsumer(new ConsumerRequestAdd() { Email = "*****@*****.**" }) as OkObjectResult).Value as Consumer; var device = new DeviceRequestAdd() { Available = true, Description = "Description...", ProjectId = "Project test", Regionid = "europe-west1", RegisteredOn = System.DateTime.Now, RegistryId = "my-registry", TenantId = Guid.NewGuid().ToString(), ConsumerId = consumer.ConsumerId.ToString() }; //------------------------------------------- var controller = new DevicesController(fixture.GetDataProvider()); var added = await controller.AddDevice(device) as OkObjectResult; Assert.NotNull(added.Value); Assert.Equal(added.StatusCode, (int)HttpStatusCode.OK); var foundItem = await controller.GetDevice((added.Value as Device).DeviceId.ToString()) as OkObjectResult; Assert.Equal(foundItem.Value as Device, added.Value); }