Esempio n. 1
0
        public async void CallAssignmentsByUnitId_Not_Exists()
        {
            var mock = new ServiceMockFacade <IUnitService, IUnitRepository>();

            mock.RepositoryMock.Setup(x => x.CallAssignmentsByUnitId(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <CallAssignment> >(new List <CallAssignment>()));
            var service = new UnitService(mock.LoggerMock.Object,
                                          mock.MediatorMock.Object,
                                          mock.RepositoryMock.Object,
                                          mock.ModelValidatorMockFactory.UnitModelValidatorMock.Object,
                                          mock.DALMapperMockFactory.DALUnitMapperMock,
                                          mock.DALMapperMockFactory.DALCallAssignmentMapperMock,
                                          mock.DALMapperMockFactory.DALUnitOfficerMapperMock);

            List <ApiCallAssignmentServerResponseModel> response = await service.CallAssignmentsByUnitId(default(int));

            response.Should().BeEmpty();
            mock.RepositoryMock.Verify(x => x.CallAssignmentsByUnitId(default(int), It.IsAny <int>(), It.IsAny <int>()));
        }