コード例 #1
0
        public void AddLection_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.AddLection(null);
        }
コード例 #2
0
        public void AddLection_Lection_MethodWasCalled()
        {
            var lection         = new Lection();
            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);

            lectionsDalStab.Setup(s => s.InsertLection(lection)).Verifiable();
            logic.AddLection(lection);
            lectionsDalStab.Verify(c => c.InsertLection(lection), Times.Once);
        }