예제 #1
0
        public void Assignment1_TestDerivedClassPants_ReturnTrue()
        {
            bool  myresult = false;
            Pants pants    = new Pants(92321344, "pants", "short pants", 1234);

            if (pants.GetType() == typeof(Pants))
            {
                myresult = true;
            }
            Assert.IsTrue(myresult, "My short pants is of type pants.");
        }
예제 #2
0
        public void Assignment1_IsPolyMorphic_ReturnTrue()
        {
            bool  myresult = false;
            Pants pants    = new Pants(1234, "jeans", "skinny jeans", 12);

            if (pants.GetType().IsSubclassOf(typeof(Clothing)))
            {
                myresult = true;
            }
            Assert.IsTrue(myresult, "Pants of type Pants and Clothing");
        }
예제 #3
0
 public string WhatIsYourClothToday()
 {
     return($"my cloth today is red {_shirts.GetType().Name} and blue {_pants.GetType().Name}");
 }