Example #1
0
        public void TestFactory()
        {
            int count = Enum.GetNames(typeof(FactoryType)).Length;

            for (int i = 0; i < count; i++)
            {
                CFactory fact = FactoryFactory.CreateFactory((FactoryType)i);
                if (fact == null)
                {
                    continue;
                }
                bool good = fact.TestFactory();
                if (!good)
                {
                    Assert.IsTrue(good);
                }
            }
        }
Example #2
0
        public void TextExcludeWhatHave()
        {
            CFactory    test1  = FactoryFactory.CreateFactory(FactType.ftBackary);
            CFactory    test2  = FactoryFactory.CreateFactory(FactType.ftBackary);
            CSmartArray array1 = new CSmartArray();
            CSmartArray array2 = new CSmartArray();

            array1.Add("хлеб", 1);
            array2.Add("хлеб", 1);
            Assert.AreEqual(array1.GetCount(), 1);
            test1.SetInput(array1);
            Assert.AreEqual(array1.GetCount(), 0);
            Assert.AreEqual(array2.GetCount(), 1);
            test2.SetInput(array2);
            Assert.AreEqual(array2.GetCount(), 0);
            test1.ExcludeWhatHave(test2);
            Assert.AreEqual(test1.GetSmartInput().GetCount(), 0);
            Assert.AreEqual(test2.GetSmartInput().GetCount(), 1);
        }
Example #3
0
 public CFactoryTest(FactType type)
 {
     m_pFactory = FactoryFactory.CreateFactory(type);
 }