예제 #1
0
        public void it_doesnt_choke_on_xml_namespace()
        {
            string xml = @"
            <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
            <ItemGroup>
            <Content Include=""blah.html"" />
            </ItemGroup>
            </Project>
            ";
            var mock = Mock.Of<IFileGlobber>(x => x.ShouldCheckFile(It.IsAny<string>()) == true);
            var sut = new ProjectFileReader(mock);
            var result = sut.GetContents(UseXml(xml)).ToList();

            Assert.That(result, Is.EquivalentTo(new[] { "blah.html" }));
        }
예제 #2
0
        public void it_can_also_check_compiled_resources()
        {
            string xml = @"
            <Project>
            <ItemGroup>
            <Compile Include='Blah.cs' />
            <Compile Include='Blah.fs' />
            </ItemGroup>
            </Project>
            ";
            var mock = Mock.Of<IFileGlobber>(x => x.ShouldCheckFile(It.IsAny<string>()) == true);
            var sut = new ProjectFileReader(mock);
            var result = sut.GetContents(UseXml(xml)).ToList();

            Assert.That(result, Is.EquivalentTo(new[] { "Blah.cs", "Blah.fs" }));
        }
예제 #3
0
        public void it_can_also_check_references()
        {
            string xml = @"
            <Project>
            <ItemGroup>
            <Reference Include=""Moq"">
            <HintPath>..\packages\Moq.dll</HintPath>
            </Reference>
            </ItemGroup>
            </Project>
            ";
            var mock = Mock.Of<IFileGlobber>(x => x.ShouldCheckFile(It.IsAny<string>()) == true);
            var sut = new ProjectFileReader(mock);
            var result = sut.GetContents(UseXml(xml)).ToList();

            Assert.That(result, Is.EquivalentTo(new[] { @"..\packages\Moq.dll" }));
        }
예제 #4
0
        public void it_uses_content_nodes_under_ItemGroup()
        {
            string xml = @"
            <Project>
            <ItemGroup>
            <Content Include='blah.html' />
            </ItemGroup>
            </Project>
            ";
            var mock = Mock.Of<IFileGlobber>(x => x.ShouldCheckFile(It.IsAny<string>()) == true);
            var sut = new ProjectFileReader(mock);
            var result = sut.GetContents(UseXml(xml)).ToList();

            Assert.That(result, Is.EquivalentTo(new[] { "blah.html" }));
        }