AddOrGetFile() public method

public AddOrGetFile ( string filePath ) : uint
filePath string
return uint
        public void ProjectSystemHelper_IsFileInProject()
        {
            // Arrange
            ProjectMock project1 = this.solutionMock.AddOrGetProject("project1");
            ProjectMock project2 = this.solutionMock.AddOrGetProject("project2");
            string      file1    = "file1";
            string      file2    = "file2";
            string      file3    = "file3";

            project1.AddOrGetFile(file1);
            project1.AddOrGetFile(file2);

            // Act + Assert
            this.testSubject.IsFileInProject(project1, file1).Should().BeTrue();
            this.testSubject.IsFileInProject(project1, file2).Should().BeTrue();
            this.testSubject.IsFileInProject(project1, file3).Should().BeFalse();
            this.testSubject.IsFileInProject(project2, file1).Should().BeFalse();
            this.testSubject.IsFileInProject(project2, file2).Should().BeFalse();
            this.testSubject.IsFileInProject(project2, file3).Should().BeFalse();
        }
Beispiel #2
0
        public void ProjectSystemHelper_IsFileInProject()
        {
            // Setup
            ProjectMock project1 = this.solutionMock.AddOrGetProject("project1");
            ProjectMock project2 = this.solutionMock.AddOrGetProject("project2");
            string      file1    = "file1";
            string      file2    = "file2";
            string      file3    = "file3";

            project1.AddOrGetFile(file1);
            project1.AddOrGetFile(file2);

            // Act + Verify
            Assert.IsTrue(this.testSubject.IsFileInProject(project1, file1));
            Assert.IsTrue(this.testSubject.IsFileInProject(project1, file2));
            Assert.IsFalse(this.testSubject.IsFileInProject(project1, file3));
            Assert.IsFalse(this.testSubject.IsFileInProject(project2, file1));
            Assert.IsFalse(this.testSubject.IsFileInProject(project2, file2));
            Assert.IsFalse(this.testSubject.IsFileInProject(project2, file3));
        }
        public void ProjectSystemHelper_IsFileInProject_DifferentCase()
        {
            // Arrange
            ProjectMock project      = this.solutionMock.AddOrGetProject("project1");
            string      existingFile = "FILENAME";
            string      newFile      = "filename";

            project.AddOrGetFile(existingFile);

            // Act + Assert
            this.testSubject.IsFileInProject(project, newFile).Should().BeTrue();
        }
Beispiel #4
0
        public void ProjectSystemHelper_IsFileInProject_DifferentCase()
        {
            // Setup
            ProjectMock project      = this.solutionMock.AddOrGetProject("project1");
            string      existingFile = "FILENAME";
            string      newFile      = "filename";

            project.AddOrGetFile(existingFile);

            // Act + Verify
            Assert.IsTrue(this.testSubject.IsFileInProject(project, newFile));
        }