Exemplo n.º 1
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IPasswordRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <Password>(null));
            var service = new PasswordService(mock.LoggerMock.Object,
                                              mock.RepositoryMock.Object,
                                              mock.ModelValidatorMockFactory.PasswordModelValidatorMock.Object,
                                              mock.BOLMapperMockFactory.BOLPasswordMapperMock,
                                              mock.DALMapperMockFactory.DALPasswordMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
        public async void TestGet()
        {
            ApiPasswordResponseModel response = await this.Client.PasswordGetAsync(1);

            response.Should().NotBeNull();
        }