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()); }
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()); }
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()); }