Beispiel #1
0
        public void GetAllBugsShouldReturnBugsCollection_Mocking()
        {
            // Arrange
            var bugs = this.GenerateBugsCollection();
            var bugLoggerFakeData = this.MockUnitOfWorkForActionAll(bugs);
            var bugsController = new BugsController(bugLoggerFakeData);
            
            // Act
            var result = bugsController.All();

            // Assert
            CollectionAssert.AreEquivalent(bugs.ToList(), result.ToList());
        }
Beispiel #2
0
        public void GetAllBugsShouldReturnBugsCollection()
        {
            // Arrange
            var bugs = this.GenerateBugsCollection();
            var bugLoggerFakeData = new BugLoggerFakeUoW();
            bugLoggerFakeData.AddBugEntities(bugs);

            var bugsController = new BugsController(bugLoggerFakeData);

            // Act
            var result = bugsController.All();

            // Assert
            Assert.AreEqual(bugs.Count, result.Count());
            CollectionAssert.AreEquivalent(bugs.ToList(), result.ToList());
        }