Example #1
0
        public async void LinksByAssignedMachineId_Not_Exists()
        {
            var mock = new ServiceMockFacade <IMachineService, IMachineRepository>();

            mock.RepositoryMock.Setup(x => x.LinksByAssignedMachineId(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <Link> >(new List <Link>()));
            var service = new MachineService(mock.LoggerMock.Object,
                                             mock.MediatorMock.Object,
                                             mock.RepositoryMock.Object,
                                             mock.ModelValidatorMockFactory.MachineModelValidatorMock.Object,
                                             mock.DALMapperMockFactory.DALMachineMapperMock,
                                             mock.DALMapperMockFactory.DALLinkMapperMock);

            List <ApiLinkServerResponseModel> response = await service.LinksByAssignedMachineId(default(int));

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