Пример #1
0
        public void TestSave()
        {
            Mock <ISummitDao> summitDaoMock = new Mock <ISummitDao>();

            summitDaoMock.Setup(x => x.Save(It.IsAny <Summit>()));

            Summit summit = new Summit();

            ISummitService summitService = new SummitService(summitDaoMock.Object);

            summitService.Save(summit);

            summitDaoMock.Verify(x => x.Save(summit), Times.Once);
        }
Пример #2
0
        public void TestSaveNull()
        {
            ISummitService summitService = new SummitService(null);

            Assert.Throws <ArgumentNullException>(() => summitService.Save(null));
        }