Ejemplo n.º 1
0
 public void TestSaveNull()
 {
     ISummitService summitService = new SummitService(null);
     Assert.Throws<ArgumentNullException>(() => summitService.Save(null));
 }
Ejemplo n.º 2
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);
        }