Exemple #1
0
        public void CreateInstanceScopedKeyString()
        {
            TestObject testObject    = new TestObject();
            string     typeScopedKey = UniqueKey.GetInstanceScopedString(testObject, "PartialKey");
            string     expectedKey   = string.Format("{0}[{1}].{2}", typeof(TestObject).FullName, testObject.GetHashCode(), "PartialKey");

            Assert.AreEqual(expectedKey, typeScopedKey);
        }
Exemple #2
0
        public void MustNotCallObjectSignatureWithType()
        {
            Type myType = typeof(TestObject);

            Assert.Throws <ArgumentException>(() => UniqueKey.GetInstanceScopedString(myType, "PartialKey"));
        }
Exemple #3
0
        public void MustNotCallObjectSignatureWithType()
        {
            Type myType = typeof(TestObject);

            UniqueKey.GetInstanceScopedString((object)myType, "PartialKey");
        }