public async void GetDeviceTypeTests()
        {
            var res = await deviceTypesController.GetDeviceType(1);

            res.AssertOnError();
            var data = res.ExtractContentDataAs <DeviceType>();

            Assert.Equal(data.Name, "Simulated Device");
            res = await deviceTypesController.GetDeviceType(2);

            res.AssertOnError();
            data = res.ExtractContentDataAs <DeviceType>();
            Assert.Equal(data.Name, "Custom Device");
        }
예제 #2
0
        public async Task GetDevice_ShouldReturnNotNull()
        {
            _mockDevTypeRepo.Setup(r => r.GetByIdAsync(1).Result).Returns(new DeviceType());
            _mockDevTypeSer.Setup(u => u.GetDeviceTypeByIdAsync(1)).ReturnsAsync(new DeviceType());

            var result = await _deviceTypesController.GetDeviceType(1);

            Assert.NotNull(result);
        }