Exemple #1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IDeviceActionRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <DeviceAction>(null));
            var service = new DeviceActionService(mock.LoggerMock.Object,
                                                  mock.RepositoryMock.Object,
                                                  mock.ModelValidatorMockFactory.DeviceActionModelValidatorMock.Object,
                                                  mock.BOLMapperMockFactory.BOLDeviceActionMapperMock,
                                                  mock.DALMapperMockFactory.DALDeviceActionMapperMock);

            ApiDeviceActionResponseModel response = await service.Get(default(int));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Exemple #2
0
        public async void TestGet()
        {
            ApiDeviceActionResponseModel response = await this.Client.DeviceActionGetAsync(1);

            response.Should().NotBeNull();
        }