Esempio n. 1
0
        public void Test_EditEntryObjectException_EntryRecord()
        {
            EntryRecord  h = new EntryRecord("Test", CompareBy.AlphabetTitle, false);
            EntryElement e = new EntryElement("http://www.duckduckgo.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            Assert.ThrowsException <System.ArgumentOutOfRangeException>(() => h.EditEntry(e, false));
        }
Esempio n. 2
0
        public void Test_EditEntryParams_EntryRecord()
        {
            EntryRecord  h = new EntryRecord("Test", CompareBy.AlphabetTitle, false);
            EntryElement e = new EntryElement("http://www.duckduckgo.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            h.AddEntry(e, false);
            Assert.AreEqual(h.GetList()[0].Title, "DuckDuckGo", "Expected and Actual Title mismatch");
            Assert.AreEqual(h.GetList()[0].Url, "http://www.duckduckgo.com", "Expected and Actual Title mismatch");

            h.EditEntry("DuckDuckGo", "DifferentTitle", "http://www.google.com", false);
            Assert.AreEqual(h.GetList()[0].Title, "DifferentTitle", "Expected and Actual Title mismatch");
            Assert.AreEqual(h.GetList()[0].Url, "http://www.google.com", "Expected and Actual Title mismatch");
        }
Esempio n. 3
0
        public void Test_EditEntryObject_EntryRecord()
        {
            EntryRecord  h = new EntryRecord("Test", CompareBy.AlphabetTitle, false);
            EntryElement e = new EntryElement("http://www.duckduckgo.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            h.AddEntry(e, false);
            Assert.AreEqual(h.GetList()[0].Title, "DuckDuckGo", "Expected and Actual Title mismatch");
            Assert.AreEqual(h.GetList()[0].Url, "http://www.duckduckgo.com", "Expected and Actual Title mismatch");

            EntryElement u = new EntryElement("http://www.google.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            h.EditEntry(u, false);
            Assert.AreEqual(h.GetList()[0].Title, "DuckDuckGo", "Expected and Actual Title mismatch");
            Assert.AreEqual(h.GetList()[0].Url, "http://www.google.com", "Expected and Actual Title mismatch");
            Assert.AreEqual(h.GetList().Count, 1, "List size of 1 expected");
        }
Esempio n. 4
0
        public void Test_EventEditEntry_EntryRecord()
        {
            bool        eventTriggered = false;
            EntryRecord h = new EntryRecord("Test", CompareBy.AlphabetTitle, false);

            h.EntryChanged += delegate { eventTriggered = true; };
            EntryElement e = new EntryElement("http://www.duckduckgo.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            Assert.AreEqual(eventTriggered, false, "The event should not have triggered");
            h.AddEntry(e, false);
            Assert.AreEqual(eventTriggered, true, "The event should have triggered");
            eventTriggered = false;
            Assert.AreEqual(eventTriggered, false, "The event should not have triggered");

            EntryElement j = new EntryElement("http://www.google.com", "DuckDuckGo", CompareBy.AlphabetTitle);

            h.EditEntry(j, false);
        }
Esempio n. 5
0
        public void Test_EditEntryParamsException_EntryRecord()
        {
            EntryRecord h = new EntryRecord("Test", CompareBy.AlphabetTitle, false);

            Assert.ThrowsException <System.ArgumentOutOfRangeException>(() => h.EditEntry("DuckDuckGo", "DifferentTitle", "http://www.google.com", false));
        }