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