void ReleaseDesignerOutlets()
 {
     if (GivenLabel != null)
     {
         GivenLabel.Dispose();
         GivenLabel = null;
     }
     if (GivenResult != null)
     {
         GivenResult.Dispose();
         GivenResult = null;
     }
     if (PhoneLabel != null)
     {
         PhoneLabel.Dispose();
         PhoneLabel = null;
     }
     if (PhoneResult != null)
     {
         PhoneResult.Dispose();
         PhoneResult = null;
     }
     if (SearchButton != null)
     {
         SearchButton.Dispose();
         SearchButton = null;
     }
     if (SearchTermText != null)
     {
         SearchTermText.Dispose();
         SearchTermText = null;
     }
     if (StatusResult != null)
     {
         StatusResult.Dispose();
         StatusResult = null;
     }
     if (SurnameLabel != null)
     {
         SurnameLabel.Dispose();
         SurnameLabel = null;
     }
     if (SurnameResult != null)
     {
         SurnameResult.Dispose();
         SurnameResult = null;
     }
     if (UpnLabel != null)
     {
         UpnLabel.Dispose();
         UpnLabel = null;
     }
     if (UpnResult != null)
     {
         UpnResult.Dispose();
         UpnResult = null;
     }
 }
        public static WhenResult When(this GivenResult @this, Func <ITestContext, Task> when)
        {
            when(@this.TestContext)
            .ConfigureAwait(false)
            .GetAwaiter()
            .GetResult();

            return(new WhenResult(@this.TestContext));
        }
        public static WhenResult <TSut, TResult> When <TSut, TResult>(this GivenResult <TSut, TResult> @this,
                                                                      Func <Task> when) where TSut : class
        {
            when().ConfigureAwait(false)
            .GetAwaiter()
            .GetResult();

            return(new WhenResult <TSut, TResult>(@this.TestContext));
        }
        public static WhenResult <TSut, TResult> When <TSut, TResult>(this GivenResult <TSut, TResult> @this,
                                                                      Func <ITestContext <TSut, TResult>, Task <TResult> > when) where TSut : class
        {
            var result = when(@this.TestContext)
                         .ConfigureAwait(false)
                         .GetAwaiter()
                         .GetResult();

            @this.TestContext.Result = result;

            return(new WhenResult <TSut, TResult>(@this.TestContext));
        }