Exemple #1
0
        public void TestChangeCompanyStep()
        {
            Mock <ICompanyRepository> companyRepository = new Mock <ICompanyRepository>();
            int   id      = 1;
            Steps step    = Steps.New;
            var   company = new Company()
            {
                CompanyId = id
            };

            companyRepository.Setup(cr => cr.ChangeCompanyStep(It.IsAny <Company>(),
                                                               It.Is <int>(it => (Enum.IsDefined(typeof(Steps), it)))));
            companyRepository.Setup(cr => cr.SaveChanges());
            ICompanyManager manager = new CompanyManager(null, companyRepository.Object);

            manager.ChangeCompanyStep(company, (int)step);
            companyRepository.Verify();
        }