public void CourseShouldntHasLessThanOneValueOfPrice(double invalidPrice) { // Arrange, Act & Assert Assert.Throws <ArgumentException>(() => BuilderCourse.New().WithPrice(invalidPrice).Build()) .WithMessage("Price should be greater than 1"); }
public void CourseShouldntHasAnEmptyOrNullName(string invalidName) { // Arrange, Act & Assert Assert.Throws <ArgumentException>(() => BuilderCourse.New().WithName(invalidName).Build()) .WithMessage("Invalid Name"); }
public void CourseShouldntHasLessThanAnHourOfWorkLoad(double invalidWorkLoad) { // Arrange, Act & Assert Assert.Throws <ArgumentException>(() => BuilderCourse.New().WithWorkload(invalidWorkLoad).Build()) .WithMessage("Work load should be greater than 1"); }
public void ShouldntAddACourseWithSameName() { var savedCourse = BuilderCourse.New().WithName(_courseDto.Name).Build(); _repositoryCourseMock.Setup(r => r.AddCourseByName(_courseDto.Name)).Returns(savedCourse); Assert.Throws <ArgumentException>(() => _storageCourse.Store(_courseDto)) .WithMessage("Course name unavailable"); }