Esempio n. 1
0
 public void CourseShouldntHasLessThanOneValueOfPrice(double invalidPrice)
 {
     // Arrange, Act & Assert
     Assert.Throws <ArgumentException>(() =>
                                       BuilderCourse.New().WithPrice(invalidPrice).Build())
     .WithMessage("Price should be greater than 1");
 }
Esempio n. 2
0
 public void CourseShouldntHasAnEmptyOrNullName(string invalidName)
 {
     // Arrange, Act & Assert
     Assert.Throws <ArgumentException>(() =>
                                       BuilderCourse.New().WithName(invalidName).Build())
     .WithMessage("Invalid Name");
 }
Esempio n. 3
0
 public void CourseShouldntHasLessThanAnHourOfWorkLoad(double invalidWorkLoad)
 {
     // Arrange, Act & Assert
     Assert.Throws <ArgumentException>(() =>
                                       BuilderCourse.New().WithWorkload(invalidWorkLoad).Build())
     .WithMessage("Work load should be greater than 1");
 }
Esempio n. 4
0
        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");
        }