コード例 #1
0
        public void PositiveExplicitGenericInterfaceMethod()
        {
            IInterfaceWithGenericMethod i = new ExplicitGenericInterfaceMethodImplementation(0);

            foreach (var x in i.Bar <string>())
            {
            }
        }
コード例 #2
0
 public void NegativeExplicitGenericInterfaceMethod2()
 {
     try
     {
         IInterfaceWithGenericMethod i = new ExplicitGenericInterfaceMethodImplementation(2);
         foreach (var x in i.Bar <string>())
         {
         }
         throw new Exception();
     }
     catch (TestRewriterMethods.PostconditionException e)
     {
         Assert.AreEqual(": Contract.Result<IEnumerable<T>>() != null", e.Message);
     }
 }
コード例 #3
0
 public void NegativeExplicitGenericInterfaceMethod2()
 {
   try
   {
     IInterfaceWithGenericMethod i = new ExplicitGenericInterfaceMethodImplementation(2);
     foreach (var x in i.Bar<string>())
     {
     }
     throw new Exception();
   }
   catch (TestRewriterMethods.PostconditionException e)
   {
     Assert.AreEqual(": Contract.Result<IEnumerable<T>>() != null", e.Message);
   }
 }
コード例 #4
0
    public void PositiveExplicitGenericInterfaceMethod()
    {
      IInterfaceWithGenericMethod i = new ExplicitGenericInterfaceMethodImplementation(0);
      foreach (var x in i.Bar<string>())
      {
      }

    }