public void GetAllDecksTest() { var sut = new CatalogBll(this.catalog.Object, this.converter.Object); var actual = sut.GetAllDecks(); this.catalog.Verify( cat => cat.GetAllDecks(), Times.Exactly(1)); Assert.That(actual, Is.All.InstanceOf(typeof(DeckDTO))); Assert.AreEqual(decks.Count, actual.Count()); }
public void GetAllCoursesTest() { var sut = new CatalogBll(this.catalog.Object, this.converter.Object); var actual = sut.GetAllCourses(); this.catalog.Verify( cat => cat.GetAllCourses(), Times.AtLeastOnce()); Assert.That(actual, Is.All.InstanceOf(typeof(CourseDTO))); Assert.AreEqual(courses.Count, actual.Count()); }
public void GetAllDecksByCourseTest() { var sut = new CatalogBll(this.catalog.Object, this.converter.Object); foreach (var course in courses) { var actual = sut.GetAllDecksByCourse(course.Name); this.catalog.Verify( cat => cat.GetAllDecksByCourse(course.Name), Times.AtLeastOnce()); Assert.That(actual, Is.All.InstanceOf(typeof(DeckDTO))); } }
public void GetAllCoursesByCategoryTest() { var sut = new CatalogBll(this.catalog.Object, this.converter.Object); foreach (var category in categories) { var actual = sut.GetAllCoursesByCategory(category.Name); this.catalog.Verify( cat => cat.GetAllCoursesByCategory(category.Name), Times.AtLeastOnce()); Assert.That(actual, Is.All.InstanceOf(typeof(CourseDTO))); } }
public void GetCourseWithDecksDTOTest() { var sut = new CatalogBll(this.catalog.Object, this.converter.Object); foreach (var course in courses) { var actual = sut.GetCourseWithDecksDTO(course.Name); this.catalog.Verify(cat => cat.GetCourse(course.Name), Times.AtLeastOnce()); this.converter.Verify( conv => conv.ConvertToCourseWithDecksDTO(It.IsAny <Course>()), Times.AtLeastOnce()); Assert.That(actual, Is.InstanceOf(typeof(CourseWithDecksDTO))); } }