public FeatureFile(string fileName, Folder folder, Feature feature) : base(fileName, folder) { if (feature == null) throw new ArgumentNullException("feature"); mContent = feature; }
public Folder(string folderName, Folder parentFolder) { if (folderName.IsNullOrWhiteSpace()) throw new ArgumentNullException("folderName"); this.folderName = folderName; this.parentFolder = parentFolder; }
public TextFile(string fileName, Folder folder, string content) : base(fileName, folder) { if (content == null) throw new ArgumentNullException("content"); mContent = content; }
public void FindCommonAncestor_NullArgument_ThrowsArgumentNullException() { var folder = new Folder("Folder Name"); var exception = Assert.Throws<ArgumentNullException>(() => folder.FindCommonAncestor(null)); exception.ParamName.ShouldEqual("other"); }
public void Constructor_WithParentFolder_SetsParentFolderProperty() { var parentFolder = new Folder("Parent Folder Name"); var folder = new Folder("Folder Name", parentFolder); folder.ParentFolder.ShouldEqual(parentFolder); }
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); }
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); }
public TestableFileBase(string fileName, Folder folder) : base(fileName, folder) { }
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); }
public void Constructor_ValidFolderName_SetsNameProperty() { var folder = new Folder("Folder Name"); folder.Name.ShouldEqual("Folder Name"); }