Пример #1
0
		public async void ByName_Not_Exists()
		{
			var mock = new ServiceMockFacade<ITenantRepository>();
			mock.RepositoryMock.Setup(x => x.ByName(It.IsAny<string>())).Returns(Task.FromResult<Tenant>(null));
			var service = new TenantService(mock.LoggerMock.Object,
			                                mock.RepositoryMock.Object,
			                                mock.ModelValidatorMockFactory.TenantModelValidatorMock.Object,
			                                mock.BOLMapperMockFactory.BOLTenantMapperMock,
			                                mock.DALMapperMockFactory.DALTenantMapperMock);

			ApiTenantResponseModel response = await service.ByName(default(string));

			response.Should().BeNull();
			mock.RepositoryMock.Verify(x => x.ByName(It.IsAny<string>()));
		}