Пример #1
0
 public void StaticPrototypeCallTest()
 {
     GenericStorage<int>.StaticPrototype.IntroduceItself = (self) => { return "test"; };
     GenericStorage<int> a = new GenericStorage<int>(10);
     Assert.That(a.IntroduceItself() == "test");
 }
Пример #2
0
 public void SimplePrototypeCallTest()
 {
     GenericStorage<int> a = new GenericStorage<int>(10);
     string[] strs = {
                         a.IntroduceItself(),
                         a.IntroduceItself("Hello, i am"),
                         a.xIntroduceItself(),
                         a.xIntroduceItself("Hello, i am")
                     };
     Assert.That(strs.All(s => s == "Hello, i am System.Int32"));
 }