Beispiel #1
0
        public void KeysWithDifferentHandlesAreNotEqual()
        {
            var animatable = new FakeAnimatable();

            var key1 = new AnimatableKey(animatable, "handle1");
            var key2 = new AnimatableKey(animatable, "handle2");

            Assert.AreNotEqual(key1, key2);
        }
Beispiel #2
0
        public void KeysWithSameAnimatableAndHandleAreEqual()
        {
            var animatable = new FakeAnimatable();

            var key1 = new AnimatableKey(animatable, "handle");
            var key2 = new AnimatableKey(animatable, "handle");

            Assert.AreEqual(key1, key2);
        }
Beispiel #3
0
        public void ThrowsWhenKeysWithSameAnimatableAdded()
        {
            var animatable = new FakeAnimatable();

            var key1 = new AnimatableKey(animatable, "handle");
            var key2 = new AnimatableKey(animatable, "handle");

            var dict = new Dictionary <AnimatableKey, object> {
                { key1, new object() }
            };

            Assert.Throws <ArgumentException> (() => {
                dict.Add(key2, new object());
            });
        }