コード例 #1
0
ファイル: InteractiveMapTest.cs プロジェクト: nbadw/sjr_atlas
        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));
        }
コード例 #2
0
ファイル: InteractiveMapTest.cs プロジェクト: nbadw/sjr_atlas
        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);
        }