public TextFile(string fileName, Folder folder, string content) : base(fileName, folder) { if (content == null) throw new ArgumentNullException("content"); this.mContent = content; }
public Folder(string folderName, Folder parentFolder) { if (folderName.IsNullOrWhiteSpace()) throw new ArgumentNullException("folderName"); this.folderName = folderName; this.parentFolder = parentFolder; }
public FeatureFile(string fileName, Folder folder, Feature feature, IFileSystem fileSystem) : base(fileName, folder, fileSystem) { if (feature == null) throw new ArgumentNullException("feature"); this.mContent = feature; }
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); }
protected FileBase(string fileName, Folder folder) { if (fileName.IsNullOrWhiteSpace()) throw new ArgumentNullException("fileName"); string name = Path.GetFileNameWithoutExtension(fileName); if (name.IsNullOrWhiteSpace()) throw new ArgumentException("Filename must consist of more than only the extension.", "fileName"); this.mName = name; if (folder == null) throw new ArgumentNullException("folder"); this.mFolder = folder; }
public TestableFileBase(string fileName, Folder folder) : base(fileName, folder) { }
public TestableFileBase(string fileName, Folder folder, IFileSystem filesSystem) : base(fileName, folder, filesSystem) { }
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"); }