public void WillNotApplyCredentialsIfUserCancels()
        {
            var applies = new RetrievesUserEnteredCredentials();

            applies.CreatePrompt = () =>
                                       {
                                           var prompt = new MockCredentialPrompt();

                                           prompt.RespondWith("it", "didn't");
                                           prompt.Result = false;

                                           return prompt;
                                       };

            var receiver = applies.Retrieve();

            receiver.Should().Be.OfType<AnonymousGitHubCredentials>();
        }
        public void WillApplyCredentialsIfUserOks()
        {
            var applies = new RetrievesUserEnteredCredentials();

            applies.CreatePrompt = () =>
                                       {
                                           var prompt = new MockCredentialPrompt();

                                           prompt.RespondWith("it", "rocks");
                                           prompt.Result = true;

                                           return prompt;
                                       };

            var credentials = applies.Retrieve().Should().Be.OfType<GitHubUserCredentials>() as GitHubUserCredentials;

            credentials.Username.Should().Equal("it");
            credentials.Password.Should().Equal("rocks");
        }