示例#1
0
		public void EmptyNonOverridenGetHashCode ()
		{
			MyAttribute a1 = new MyAttribute ();
			MyAttribute a2 = new MyAttribute ();
			Assert.AreEqual (a1.GetHashCode (), a2.GetHashCode (), "identical argument-less");
			Assert.AreEqual (a1.GetHashCode (), a1.TypeId.GetHashCode (), "Empty/TypeId");

			MySubAttribute b1 = new MySubAttribute ();
			Assert.AreNotEqual (a1.GetHashCode (), b1.GetHashCode (), "non-identical-types");
			Assert.AreEqual (b1.GetHashCode (), b1.TypeId.GetHashCode (), "Empty/TypeId/Sub");
		}
    public bool PosTest1()
    {
        bool retVal = true;
        TestLibrary.TestFramework.BeginScenario("Attribute.GetHashCode()");
		try
		{
			MyAttribute myAttr = new MyAttribute();
			myAttr.GetHashCode();
		}
		catch (FieldAccessException e)
		{
			TestLibrary.TestFramework.LogError("001", "DDB 125472 is present. Exception:"+e);
			retVal = false;
		}
		catch (Exception e)
		{
			TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
			retVal = false;
		}
        return retVal;
    }
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("Attribute.GetHashCode()");
        try
        {
            MyAttribute myAttr = new MyAttribute();
            myAttr.GetHashCode();
        }
        catch (FieldAccessException e)
        {
            TestLibrary.TestFramework.LogError("001", "DDB 125472 is present. Exception:" + e);
            retVal = false;
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
示例#4
0
 public bool PosTest1()
 {
     bool retVal = true;
     TestLibrary.TestFramework.BeginScenario("PosTest1:Get the Attribute Hash Code");
     try
     {
         int intVal = TestLibrary.Generator.GetInt32(-55);
         MyAttribute myAttr = new MyAttribute(intVal);
         int hashcode = myAttr.GetHashCode();
         if (hashcode != intVal)
         {
             TestLibrary.TestFramework.LogError("001", "the ExpectResult is not the ActualResult");
             retVal = false;
         }            
     }
     catch (Exception e)
     {
         TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
         retVal = false;
     }
     return retVal;
 }
示例#5
0
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1:Get the Attribute Hash Code");
        try
        {
            int         intVal   = TestLibrary.Generator.GetInt32(-55);
            MyAttribute myAttr   = new MyAttribute(intVal);
            int         hashcode = myAttr.GetHashCode();
            if (hashcode != intVal)
            {
                TestLibrary.TestFramework.LogError("001", "the ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
示例#6
0
		public void EmptyNonOverridenGetHashCode ()
		{
			MyAttribute a1 = new MyAttribute ();
			MyAttribute a2 = new MyAttribute ();
			Assert.AreEqual (a1.GetHashCode (), a2.GetHashCode (), "identical argument-less");
			Assert.AreEqual (a1.GetHashCode (), a1.TypeId.GetHashCode (), "Empty/TypeId");

			MySubAttribute b1 = new MySubAttribute ();
			Assert.AreNotEqual (a1.GetHashCode (), b1.GetHashCode (), "non-identical-types");
			Assert.AreEqual (b1.GetHashCode (), b1.TypeId.GetHashCode (), "Empty/TypeId/Sub");
		}