Esempio n. 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");
        }
Esempio n. 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.");
 }
Esempio n. 3
0
 public void MustNotCourseHaveValueGreaterThan0(double value)
 {
     Assert.Throws <ArgumentException>(() => CourseBuilder.Builder().WithValue(value).Build())
     .WithMessage("Property 'Value' must be a positive value.");
 }
Esempio n. 4
0
 public void MustNotCourseHaveInvalidName(string name)
 {
     Assert.Throws <ArgumentException>(() => CourseBuilder.Builder().WithName(name).Build())
     .WithMessage("Property 'Name' is Invalid.");
 }