public void MapServerRequestToResponse()
        {
            var mapper = new ApiVPersonServerModelMapper();
            var model  = new ApiVPersonServerRequestModel();

            model.SetProperties("A");
            ApiVPersonServerResponseModel response = mapper.MapServerRequestToResponse(1, model);

            response.Should().NotBeNull();
            response.PersonName.Should().Be("A");
        }
예제 #2
0
        public async void Get_ShouldReturnNullBecauseRecordNotFound()
        {
            var mock = new ServiceMockFacade <IVPersonService, IVPersonRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <VPerson>(null));
            var service = new VPersonService(mock.LoggerMock.Object,
                                             mock.MediatorMock.Object,
                                             mock.RepositoryMock.Object,
                                             mock.ModelValidatorMockFactory.VPersonModelValidatorMock.Object,
                                             mock.DALMapperMockFactory.DALVPersonMapperMock);

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

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