예제 #1
0
            public void WhenCategoryExists_ThenReturnCategory(int code, string name)
            {
                var result = HttpStatusCodeCategory.CreateFromCategoryCode(code);

                Assert.That(result.Code, Is.EqualTo(code));
                Assert.That(result.Name, Is.EqualTo(name));
                Assert.That(result.Description.Length, Is.GreaterThan(0));
            }
예제 #2
0
            public void WhenCategoryExists_ThenReturnCategory(int statusCode, int expected)
            {
                var result = HttpStatusCodeCategory.CreateFromHttpStatusCode(statusCode);

                Assert.That(result.Code, Is.EqualTo(expected));
            }
예제 #3
0
 public void WhenHttpStatusCodeNotValid_ThenThrowException(int statusCode)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => HttpStatusCodeCategory.CreateFromHttpStatusCode(statusCode));
 }
예제 #4
0
 public void WhenCategoryDoesNotExist_ThenThrowException(int categoryCode)
 {
     Assert.Throws <ArgumentException>(() => HttpStatusCodeCategory.CreateFromCategoryCode(categoryCode));
 }