public void SavingRecordingSanitizesValues() { var tempFile = Path.GetTempFileName(); var sanitizer = new TestSanitizer(); TestRecording recording = new TestRecording(RecordedTestMode.Record, tempFile, sanitizer, new RecordMatcher()); recording.SetVariable("A", "secret"); recording.Dispose(true); var text = File.ReadAllText(tempFile); StringAssert.DoesNotContain("secret", text); }
public void RecordingSessionSanitizeSanitizesVariables() { var sanitizer = new TestSanitizer(); var session = new RecordSession(); session.Variables["A"] = "secret"; session.Variables["B"] = "Totally not a secret"; session.Sanitize(sanitizer); Assert.AreEqual("SANITIZED", session.Variables["A"]); Assert.AreEqual("Totally not a SANITIZED", session.Variables["B"]); }