public void GetAll_ReturnsListOfPlatformTypes()
        {
            var platformTypesList = fixture.Create <IEnumerable <PlatformType> >();

            mockPlatformTypeRepo.Setup(x => x.GetAll()).Returns(platformTypesList);
            mockPlatformTypeService.Setup(x => x.GetAll()).Returns(platformTypesList);

            var result = platformTypeService.GetAll();

            mockPlatformTypeRepo.Verify(x => x.GetAll(), Times.Once());
            //mockPlatformTypeService.Verify(x => x.GetAll(), Times.Once());

            Assert.IsNotNull(result);
            Assert.IsInstanceOf <IEnumerable <PlatformType> >(result);
            Assert.IsNotEmpty(result);
        }
Exemplo n.º 2
0
        public void GetAllPlatformTypes_AllPlatformTypesReturned()
        {
            _uow.Setup(uow => uow.PlatformTypes.GetAll()).Returns(_fakePlatformTypes);

            var resultPlatformType = _sut.GetAll();

            Assert.Equal(resultPlatformType.Count(), _fakePlatformTypes.Count);
        }
Exemplo n.º 3
0
        public void Check_That_Platform_Type_Service_Gets_All_Platform_Types()
        {
            //Arrange
            var testList = new List <PlatformType>
            {
                new PlatformType(),
                new PlatformType(),
            };

            var mock = new Mock <IUnitOfWork>();

            mock.Setup(m => m.PlatformTypeRepository.GetAll())
            .Returns(testList);

            var platformTypeService = new PlatformTypeService(mock.Object);

            //Act
            IEnumerable <PlatformTypeModel> platformTypes = platformTypeService.GetAll();

            //Assert
            Assert.IsTrue(testList.Count == platformTypes.Count());
        }