Exemple #1
0
        public void Long_Add_Lookup()
        {
            var pairs = new UniquePairs <long>();

            pairs.Add(10, 100);

            Assert.AreEqual(100, pairs.Other(10));
            Assert.AreEqual(10, pairs.Other(100));

            Assert.IsFalse(pairs.Contains(12345));
            Assert.IsTrue(pairs.Contains(10));
            Assert.IsTrue(pairs.Contains(100));

            Assert.IsTrue(pairs.Remove(100));
            Assert.IsFalse(pairs.Contains(10));
            Assert.IsFalse(pairs.Contains(100));
        }
Exemple #2
0
        public void String_Add_Lookup()
        {
            var pairs = new UniquePairs <string>();

            pairs.Add("test1", "test2");

            Assert.AreEqual("test2", pairs.Other("test1"));
            Assert.AreEqual("test1", pairs.Other("test2"));

            Assert.IsFalse(pairs.Contains("12345"));
            Assert.IsTrue(pairs.Contains("test1"));
            Assert.IsTrue(pairs.Contains("test2"));

            pairs.Remove("test1");
            Assert.IsFalse(pairs.Contains("test1"));
            Assert.IsFalse(pairs.Contains("test2"));
        }
Exemple #3
0
        public void String_OtherNotFound()
        {
            var pairs = new UniquePairs <string>();

            pairs.Other("asdf");
        }
Exemple #4
0
        public void Long_OtherNotFound()
        {
            var pairs = new UniquePairs <long>();

            pairs.Other(1234);
        }