Пример #1
0
 public static void AssertStatusIs(this ITestResponse response, int expectedStatus)
 {
     if (response.Status != expectedStatus)
     {
         throw new FrankAssertionException($"Expected {expectedStatus}, found {response.Status}");
     }
 }
Пример #2
0
        public static void AssertJsonBodyMatches(this ITestResponse response, object expected)
        {
            var expectedString = JsonConvert.SerializeObject(expected);

            if (response.Body != expectedString)
            {
                throw new FrankAssertionException($"Expected {expectedString}, found {response.Body}");
            }
        }
Пример #3
0
 public static void AssertIsOk(this ITestResponse response) => response.AssertStatusIs(200);
Пример #4
0
 public static void AssertIsNotFound(this ITestResponse response) => response.AssertStatusIs(404);