Esempio n. 1
0
        public void TestFindByTitle()
        {
            string testTitle = "title that matches exactly";

            InteractiveMap matchingMap = new InteractiveMap();
            matchingMap.Title = testTitle;
            matchingMap.Create();

            InteractiveMap almostExact = new InteractiveMap();
            almostExact.Title = testTitle + " but not quite";
            almostExact.Create();

            InteractiveMap notEvenClose = new InteractiveMap();
            notEvenClose.Title = "not even close to the title";
            notEvenClose.Create();

            Flush();

            Assert.AreEqual(matchingMap, InteractiveMap.FindByTitle(testTitle));
        }
Esempio n. 2
0
        public void TestFindByTitleWhenTwoTitlesMatch()
        {
            string testTitle = "title that matches exactly";

            InteractiveMap firstMatchingMap = new InteractiveMap();
            firstMatchingMap.Title = testTitle;
            firstMatchingMap.Create();

            InteractiveMap secondMatchingMap = new InteractiveMap();
            secondMatchingMap.Title = testTitle;
            secondMatchingMap.Create();

            Flush();

            InteractiveMap returnedMap = InteractiveMap.FindByTitle(testTitle);
            Assert.AreEqual(firstMatchingMap, returnedMap);
            Assert.AreNotEqual(secondMatchingMap, returnedMap);
        }