Exemple #1
0
        public void GetAll_ShouldReturnAllPrintersFromDatabase_WhickAreNotDeleted()
        {
            // Arrange
            var mockedEfRepository = new Mock <IEfRepository <VinylCutter> >();
            var mockedUnitOfWork   = new Mock <IUnitOfWork>();

            mockedEfRepository.Setup(x => x.All);

            var service = new VinylCuttersService(mockedEfRepository.Object, mockedUnitOfWork.Object);

            // Act
            var result = service.GetAll();

            // Assert
            mockedEfRepository.Verify(x => x.All, Times.Once);
        }
Exemple #2
0
        public void AddComputer_ShouldAddPrinterToDatabase()
        {
            // Arrange
            var mockedEfRepository = new Mock <IEfRepository <VinylCutter> >();
            var mockedUnitOfWork   = new Mock <IUnitOfWork>();
            var computer           = new VinylCutter();

            mockedEfRepository.Setup(x => x.Add(computer));

            var service = new VinylCuttersService(mockedEfRepository.Object, mockedUnitOfWork.Object);


            // Act
            service.Add(computer);

            // Assert
            mockedEfRepository.Verify(x => x.Add(computer), Times.Once);
        }