public void CompactLroPolling() { CompactLroEntries compactLro = new CompactLroEntries(); compactLro.Process(OriginalRecordedPack); ProcessedPack = compactLro.ProcessedEntryPack; ProcessedPack.Variables = OriginalRecordedPack.Variables; ProcessedPack.Names = OriginalRecordedPack.Names; }
public ProcessRecordedFiles(string recordedFilePath) : this() { if (File.Exists(recordedFilePath)) { OriginalRecordedPack = RecordEntryPack.Deserialize(recordedFilePath); OriginalFilePath = recordedFilePath; BackupFilePath = string.Concat(Path.Combine(Path.GetDirectoryName(recordedFilePath), Path.GetFileNameWithoutExtension(recordedFilePath)), ".pijson"); } }
public void TestRecordingWithVariablesStoresVariable() { HttpMockServer.Initialize(this.GetType(), TestUtilities.GetCurrentMethodName(), HttpRecorderMode.Record); FakeHttpClient client = CreateClient(); var result = client.DoStuffA().Result; HttpMockServer.Variables["varA"] = "varA-value"; HttpMockServer.Flush(currentDir); HttpMockServer.Variables.Clear(); var recording = RecordEntryPack.Deserialize(Path.Combine(HttpMockServer.CallerIdentity, TestUtilities.GetCurrentMethodName() + ".json")); Assert.Equal("varA-value", recording.Variables["varA"]); }
public void TestRecordingWithTwoMethodsWritesAllData() { HttpMockServer.Initialize(this.GetType(), "testA", HttpRecorderMode.Record); FakeHttpClient client1 = CreateClient(); FakeHttpClient client2 = CreateClient(); var result1 = client1.DoStuffA().Result; var result2 = client2.DoStuffA().Result; var name = HttpMockServer.GetAssetName("testA", "tst"); HttpMockServer.Flush(currentDir); RecordEntryPack pack = RecordEntryPack.Deserialize(Path.Combine(HttpMockServer.CallerIdentity, "testA.json")); Assert.NotNull(name); Assert.True(File.Exists(Path.Combine(HttpMockServer.CallerIdentity, "testA.json"))); Assert.Equal(2, pack.Entries.Count); Assert.Equal(1, pack.Names["testA"].Count); }