public void EvaluateServerElapsedTimeTest_Successful() { var result = JsonConvert.DeserializeObject <TestResult>(File.ReadAllText("Fixtures/TestResultFixture.json")); var asserter = new TestAsserter(result) .EvaluateServerElapsedTime((x) => x == 242) .AssertAll(); _logger.LogInformation(JsonConvert.SerializeObject(asserter)); Assert.True(asserter.FirstOrDefault().IsTrue); }
public void CustomPropertyAddTest_Failed() { var result = JsonConvert.DeserializeObject <TestResult>(File.ReadAllText("Fixtures/TestResultFixture.json")); var asserter = new TestAsserter(result) .EvaluateTotalElapsedTime((x) => x == 123124) .AssertAll(); _logger.LogInformation(JsonConvert.SerializeObject(asserter)); Assert.False(asserter.FirstOrDefault().IsTrue); }
public void EvaluateLogicalReadsTest_FailedWhenNull() { var result = JsonConvert.DeserializeObject <TestResult>(File.ReadAllText("Fixtures/TestResultFixture.json")); var asserter = new TestAsserter(result) .EvaluateLogicalReads((x) => x == 24234) .AssertAll(); _logger.LogInformation(JsonConvert.SerializeObject(asserter)); Assert.False(asserter.FirstOrDefault().IsTrue); }
public void CustomPropertyAddTest_Successful() { var result = JsonConvert.DeserializeObject <TestResult>(File.ReadAllText("Fixtures/TestResultFixture.json")); var asserter = new TestAsserter(result) .EvaluateTotalElapsedTime((x) => x == 447) .WithCustomProperty(new KeyValuePair <string, string>("script", result.Script)) .AssertAll(); _logger.LogInformation(JsonConvert.SerializeObject(asserter)); Assert.True(asserter.FirstOrDefault().IsTrue); Assert.True(asserter.FirstOrDefault().CustomProperties.Count == 1); }