Exemplo n.º 1
0
        public void CompanyAdd_Successful()
        {
            const string newCompanyName = "New Company";

            // 1. Pre-checks
            int count = StaticData.Companies.Count();

            Assert.IsFalse(StaticData.Companies.Any(i => i.Name == newCompanyName), Messages.Settings.ShouldNotExist);

            // 2. Perform the insert
            var result = controller.CompanyAdd(newCompanyName);

            IsPartial(result);

            // 3. Ensure changes are done
            Assert.AreEqual(StaticData.Companies.Count(), count + 1, Messages.Settings.CountShouldBeOneMore);
            Assert.IsTrue(StaticData.Companies.Any(i => i.Name == newCompanyName), Messages.Settings.ShouldExist);
        }