Beispiel #1
0
        public FeatureFile(string fileName, Folder folder, Feature feature)
            : base(fileName, folder)
        {
            if (feature == null) throw new ArgumentNullException("feature");

            mContent = feature;
        }
Beispiel #2
0
        public Folder(string folderName, Folder parentFolder)
        {
            if (folderName.IsNullOrWhiteSpace()) throw new ArgumentNullException("folderName");

            this.folderName = folderName;
            this.parentFolder = parentFolder;
        }
Beispiel #3
0
        public TextFile(string fileName, Folder folder, string content)
            : base(fileName, folder)
        {
            if (content == null) throw new ArgumentNullException("content");

            mContent = content;
        }
Beispiel #4
0
        public void FindCommonAncestor_NullArgument_ThrowsArgumentNullException()
        {
            var folder = new Folder("Folder Name");

            var exception = Assert.Throws<ArgumentNullException>(() => folder.FindCommonAncestor(null));

            exception.ParamName.ShouldEqual("other");
        }
Beispiel #5
0
        public void Constructor_WithParentFolder_SetsParentFolderProperty()
        {
            var parentFolder = new Folder("Parent Folder Name");

            var folder = new Folder("Folder Name", parentFolder);

            folder.ParentFolder.ShouldEqual(parentFolder);
        }
Beispiel #6
0
        public void FindCommonAncestor_ItsOwnParent_ReturnsParent()
        {
            var parentFolder = new Folder("Parent Folder Name");

            var folder = new Folder("Folder Name", parentFolder);

            ITreeItem commonAncestor = folder.FindCommonAncestor(parentFolder);

            commonAncestor.ShouldEqual(parentFolder);
        }
Beispiel #7
0
        public void FindCommonAncestor_TwoSiblings_ReturnsParent()
        {
            var parentFolder = new Folder("Parent Folder Name");

            var sibling1 = new Folder("Sibling 1", parentFolder);
            var sibling2 = new Folder("Sibling 2", parentFolder);

            ITreeItem commonAncestor = sibling1.FindCommonAncestor(sibling2);

            commonAncestor.ShouldEqual(parentFolder);
        }
Beispiel #8
0
 public TestableFileBase(string fileName, Folder folder)
     : base(fileName, folder)
 {
 }
Beispiel #9
0
        public void FindCommonAncestor_AFolderAndItsChild_ReturnsTheFolder()
        {
            var folder = new Folder("Folder");
            var itsChild = new Folder("Its child", folder);

            ITreeItem commonAncestor = folder.FindCommonAncestor(itsChild);

            commonAncestor.ShouldEqual(folder);
        }
Beispiel #10
0
        public void Constructor_ValidFolderName_SetsNameProperty()
        {
            var folder = new Folder("Folder Name");

            folder.Name.ShouldEqual("Folder Name");
        }