Ejemplo n.º 1
0
        public void ContainsMember()
        {
            var compiler = new Mock <ICompilerServices>();
            var vm       = new VirtualMachine(compiler.Object);
            var proto    = new TestPrototype(vm, null);

            proto.OwnMembers.Add("b", "b");
            Assert.IsTrue(proto.ContainsMember("a"));
            Assert.IsTrue(proto.ContainsMember("b"));
        }
Ejemplo n.º 2
0
        public void GetMember()
        {
            var compiler = new Mock <ICompilerServices>();
            var vm       = new VirtualMachine(compiler.Object);
            var proto    = new TestPrototype(vm, null);

            proto.OwnMembers.Add("b", "b");
            var actual = proto.GetMember("a");

            Assert.IsTrue(proto.OwnMembers.ContainsKey("a"));
            Assert.IsTrue(actual.StrictEqualsTo("a"));
            Assert.IsTrue(proto.GetMember("b").StrictEqualsTo("b"));
        }
Ejemplo n.º 3
0
        public void GetEnumerator()
        {
            var compiler = new Mock <ICompilerServices>();
            var vm       = new VirtualMachine(compiler.Object);
            var proto    = new TestPrototype(vm, null);

            proto.OwnMembers.Add("b", "b");
            var expected = new HashSet <string> {
                "a", "b"
            };
            var actual     = new HashSet <string>();
            var enumerator = proto.GetEnumerator();

            while (enumerator.MoveNext())
            {
                actual.Add(enumerator.Current.CastToString());
            }
            Assert.IsTrue(actual.SetEquals(expected));
        }
        static void Main(string[] args)
        {
            TestBridge cls1 = new TestBridge();

            cls1.Execute();

            TestFactory cls5 = new TestFactory();

            cls5.Execute();

            TestBuilder cls15 = new TestBuilder();

            cls15.Execute();

            TestPrototype cls9 = new TestPrototype();

            cls9.Execute();

            TestObserver cls7 = new TestObserver();

            cls7.Execute();

            TestAdaptor cls = new TestAdaptor();

            cls.Execute();

            TestDecorater cls4 = new TestDecorater();

            cls4.Execute();

            TestComposite cls3 = new TestComposite();

            cls3.Execute();

            TestProxy cls10 = new TestProxy();

            cls10.Execute();

            TestIterator cls6 = new TestIterator();

            cls6.Execute();

            TestState cls14 = new TestState();

            cls14.Execute();

            TestCommand cls2 = new TestCommand();

            cls2.Execute();

            // ************
            TestProducerConsumer cls8 = new TestProducerConsumer();

            cls8.Execute();

            TestReaderWriter cls11 = new TestReaderWriter();

            cls11.Execute();

            TestSimpleThread cls12 = new TestSimpleThread();

            cls12.Execute();

            TestSingleton cls13 = new TestSingleton();

            cls13.Execute();
        }
Ejemplo n.º 5
0
 private void button17_Click(object sender, EventArgs e)
 {
     TestPrototype.Testar();
 }