예제 #1
0
        public void MissingFix(
            FilePath path,
            [Frozen] MockFileSystem fs,
            NotExistsError sut)
        {
            sut.RunFix(path);
            var doc = XDocument.Load(fs.FileStream.Create(path, FileMode.Open, FileAccess.Read));

            doc.Should().BeEquivalentTo(NotExistsError.TypicalFile());
        }
예제 #2
0
        public void CorruptFix(
            FilePath path,
            [Frozen] MockFileSystem fs,
            CorruptError sut)
        {
            fs.File.WriteAllText(path, "Whut");
            sut.RunFix(path);
            var doc = XDocument.Load(fs.FileStream.Create(path, FileMode.Open, FileAccess.Read));

            doc.Should().BeEquivalentTo(NotExistsError.TypicalFile());
        }
예제 #3
0
        public void NoConfigurationFix(
            FilePath path,
            [Frozen] MockFileSystem fs,
            CorruptError sut)
        {
            fs.File.WriteAllText(path, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<something />");
            sut.RunFix(path);
            var doc = XDocument.Load(fs.FileStream.Create(path, FileMode.Open, FileAccess.Read));

            doc.Should().BeEquivalentTo(NotExistsError.TypicalFile());
        }
        public void MissingPackageSourcesFix(
            FilePath path,
            [Frozen] MockFileSystem fs,
            MissingNugetOrgError sut)
        {
            fs.File.WriteAllText(path, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                                 "<configuration>" +
                                 "</configuration>");
            sut.RunFix(path);
            var doc = XDocument.Load(fs.FileStream.Create(path, FileMode.Open, FileAccess.Read));

            doc.Should().BeEquivalentTo(NotExistsError.TypicalFile());
        }