コード例 #1
0
        public void AddFolderToStructureThenPreviousCountAndCurrentCountNotEqual()
        {
            var dataContext = new MongoDataContext();
            var result = dataContext.GetFileStructure("harageth").FirstOrDefault();
            int i = result.folders.Count;
            Folder insertFolder = new Folder();
            insertFolder.folderName = "ATestFolder";
            result.folders.Add(insertFolder);

            dataContext.UpdateFileStructure(result);

            var result2 = dataContext.GetFileStructure("harageth").FirstOrDefault();
            int j = result2.folders.Count;
            Assert.AreNotEqual(i,j);
        }
コード例 #2
0
        public void AddFolderToStructureThenListHasOneMoreItem()
        {
            var dataContext = new MongoDataContext();
            var result = dataContext.GetFileStructure("harageth").FirstOrDefault();
            int i = result.folders.Count;
            Folder insertFolder = new Folder();
            insertFolder.folderName = "ATestFolder";
            result.folders.Add(insertFolder);

            dataContext.UpdateFileStructure(result);

            var result2 = dataContext.GetFileStructure("harageth").FirstOrDefault();
            int j = result2.folders.Count;
            Assert.AreEqual(i+1, j);
        }
コード例 #3
0
        public void AddFolderToStructureThenListHasSpecificItem()
        {
            var dataContext = new MongoDataContext();
            var result = dataContext.GetFileStructure("harageth").FirstOrDefault();
            int i = result.folders.Count;
            Folder insertFolder = new Folder();
            insertFolder.folderName = "ATestFolder";
            result.folders.Add(insertFolder);

            dataContext.UpdateFileStructure(result);

            var result2 = dataContext.GetFileStructure("harageth").FirstOrDefault();
            Folder newFolder = result2.folders.Find(x => x.folderName == "ATestFolder");
            Assert.AreEqual<string>(newFolder.folderName, "ATestFolder");
        }