Ejemplo n.º 1
0
        public void AddStudent_Null_NullReferenceException()
        {
            var studentsDalStab = new Mock <IStudentsDal>();
            var lectorsDalStab  = new Mock <ILectorsDal>();
            var lectionsDalStab = new Mock <ILectionsDal>();
            var journalDalStab  = new Mock <IStudentsAndLectionsDal>();
            var logic           = new LearningBL(new MockConfig(""), new MockLogger(), studentsDalStab.Object, journalDalStab.Object, lectionsDalStab.Object, lectorsDalStab.Object);

            logic.AddStudent(null);
        }
Ejemplo n.º 2
0
        public void AddStudent_Student_MethodWasCalled()
        {
            var student         = new Student(new StudentId(1), "test", "student", 0, 0, "222222", "*****@*****.**");
            var mockConfig      = new MockConfig("");
            var mockLogger      = new MockLogger();
            var studentsDalStab = new Mock <IStudentsDal>();
            var lectorsDalStab  = new Mock <ILectorsDal>();
            var lectionsDalStab = new Mock <ILectionsDal>();
            var journalDalStab  = new Mock <IStudentsAndLectionsDal>();
            var logic           = new LearningBL(mockConfig, mockLogger, studentsDalStab.Object, journalDalStab.Object, lectionsDalStab.Object, lectorsDalStab.Object);

            studentsDalStab.Setup(s => s.InsertStudent(student)).Verifiable();
            logic.AddStudent(student);
            studentsDalStab.Verify(c => c.InsertStudent(student), Times.Once);
        }