AddCompile() public method

public AddCompile ( string file ) : ProjectWriter
file string
return ProjectWriter
        public void CanAddCompileFileInProject()
        {
            var project = CsProjects.SampleProjectSimple;
            var writer = new ProjectWriter(project);
            writer.AddCompile("__test__");

            var newProject = writer.GetXml();

            StringAssert.Contains("<Compile Include=\"__test__\" />", newProject);
        }
        public void CanAddCompileFileWithSlashInProjectAndItWillChangeToBackslash()
        {
            var project = CsProjects.SampleProjectSimple;
            var writer = new ProjectWriter(project);
            writer.AddCompile("__test__/asdasd");

            var newProject = writer.GetXml();

            StringAssert.Contains("<Compile Include=\"__test__\\asdasd\" />", newProject);
        }
        public void AddingDuplicatedFileWontCreateNew()
        {
            var project = CsProjects.SampleProjectSimple;
            var writer = new ProjectWriter(project);
            writer.AddCompile(@"Common\EnumerableExtensions.cs");

            var newProject = writer.GetXml();

            Assert.AreEqual(
                newProject.IndexOf("Include=\"Common\\EnumerableExtensions.cs\" />"),
                newProject.LastIndexOf("Include=\"Common\\EnumerableExtensions.cs\" />"), "two occurrences");
        }