예제 #1
0
        private static CheckResult Analyze(Response response, RedirectUrls urls)
        {
            var result = new CheckResult();

            if (response.StatusCode == 301)
            {
                var redirectResponse = (RedirectResponse)response;
                result.IsOk    = (redirectResponse.RedirectUrl.Equals(urls.New, StringComparison.CurrentCultureIgnoreCase));
                result.Details = $"{response.StatusCode} - {urls.Old} -> {redirectResponse.RedirectUrl}, Expected: {urls.New}";
            }
            else
            {
                result.IsOk    = false;
                result.Details = $"{response.StatusCode} - {urls.Old}, Expected: {urls.New}";
            }
            return(result);
            //var redirectResponse = response as RedirectResponse;

            //if (redirectResponse != null)
            //{ }
            //else { }
        }
예제 #2
0
 public void Add(CheckResult checkResult)
 {
     Items.Add(checkResult);
 }