Esempio n. 1
0
        public void TestOnDelete()
        {
            var mockSet     = GenerateMock();
            var mockContext = new Mock <CompanyDBEntities>();

            mockContext.Setup(m => m.Companies).Returns(mockSet.Object);
            var companyContext = new CompanyDBContext(mockContext.Object);

            companyContext.DeleteCompany(companyContext.FindCompanyById(1));
            mockSet.Verify(m => m.Remove(It.IsAny <Company>()), Times.Once());
        }