Exemple #1
0
        public void GetObjectIdTest()
        {
            var objectId = new ObjectId();
            var product  = new DiaryProduct(new ClassId(""), objectId);

            GetObjectIdTest(product, objectId);
        }
Exemple #2
0
        /// <summary>
        /// Tests the ObjectId method using polymorphism.
        /// </summary>
        public void GetObjectIdTest(DiaryProduct product, ObjectId objectId)
        {
            var actual = product.GetObjectId();

            Assert.AreEqual(objectId.AsInt(), actual.AsInt(), "Data");

            Assert.AreEqual(objectId.GetHashCode(), actual.GetHashCode(), "Identity");
        }
Exemple #3
0
        public void GetClassIdTest()
        {
            var className = "Fonzie";
            var classId   = new ClassId(className);
            var product   = new DiaryProduct(classId, new ObjectId());

            GetClassIdTest(product, className);
        }
Exemple #4
0
        /// <summary>
        /// Tests GetClassId method using polymorphism.
        /// </summary>
        internal void GetClassIdTest(DiaryProduct product, String className)
        {
            var classId        = product.GetClassId();
            var productClassId = new ClassId(className);

            var expected = 0;
            var actual   = classId.CompareTo(productClassId);

            Assert.AreEqual(expected, actual);
        }