Exemplo n.º 1
0
        public void TestSave()
        {
            Mock <ISummitGroupDao> summitGroupDaoMock = new Mock <ISummitGroupDao>();

            summitGroupDaoMock.Setup(x => x.Save(It.IsAny <SummitGroup>()));

            SummitGroup summitGroup = new SummitGroup();

            ISummitGroupService summitGroupService = new SummitGroupService(summitGroupDaoMock.Object);

            summitGroupService.Save(summitGroup);

            summitGroupDaoMock.Verify(x => x.Save(summitGroup), Times.Once);
        }
Exemplo n.º 2
0
        public void TestSaveNull()
        {
            ISummitGroupService summitGroupService = new SummitGroupService(null);

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