Beispiel #1
0
        public void MustNoCreateACourseWithTheSameNameAsAnother()
        {
            var existingCourse = CourseBuilder.Builder().WithName(_courseVM.Name).Build();

            _courseRepository.Setup(x => x.GetCourse(_courseVM.Name)).Returns(existingCourse);

            Assert.Throws <ArgumentException>(() => _courseService.Store(_courseVM))
            .WithMessage("Course already exists");
        }
Beispiel #2
0
 public void MustNotCourseHaveWorkloadSmallerThan1(double workload)
 {
     Assert.Throws <ArgumentException>(() => CourseBuilder.Builder().WithWorkload(workload).Build())
     .WithMessage("Property 'Workload' must need to be greater than zero.");
 }
Beispiel #3
0
 public void MustNotCourseHaveValueGreaterThan0(double value)
 {
     Assert.Throws <ArgumentException>(() => CourseBuilder.Builder().WithValue(value).Build())
     .WithMessage("Property 'Value' must be a positive value.");
 }
Beispiel #4
0
 public void MustNotCourseHaveInvalidName(string name)
 {
     Assert.Throws <ArgumentException>(() => CourseBuilder.Builder().WithName(name).Build())
     .WithMessage("Property 'Name' is Invalid.");
 }