public void CheckThatXmlFileDidNotChangeAfterSort(string fileName) { string suppressionFilePath = GetFileFullPath(fileName); string oldContent = File.ReadAllText(suppressionFilePath); HashSet <SuppressMessage> messages = SuppressionFile.LoadMessages(_fileService, suppressionFilePath); var xDocument = SuppressionFile.NewDocumentFromMessages(messages); var newContent = xDocument.GetXDocumentStringWithDeclaration(); newContent.Should().Equals(oldContent); }
public void CheckLoadOfSuppressionFile(string fileName) { const int expectedCount = 3629; var messagesToCheck = GetSuppressionMessagesToCheck(); string suppressionFilePath = GetFileFullPath(fileName); HashSet <SuppressMessage> messages = SuppressionFile.LoadMessages(_fileService, suppressionFilePath); messages.Should().NotBeNull(); messages.Should().HaveCount(expectedCount); messages.Should().ContainInOrder(messagesToCheck); }