Inheritance: IMingleServer
 public void GetProjectListIntegrationTest()
 {
     var hostUrl = Environment.GetEnvironmentVariable("MINGLETARGET"); 
     const string loginName = "mingleuser"; 
     const string password = "******"; 
     var target = new MingleServer(hostUrl, loginName, password); 
     const int expected = 2;
     var actual = target.GetProjectList();
     Assert.AreEqual(expected, actual.Count);
 }
 public void GetProjectList()
 {
     const string host = @"http://localhost:8080";
     const string user = "******";
     const string pw = "secret";
     var mingle = new MingleServer(host, user, pw);
     var depart = DateTime.Now;
     var list = mingle.GetProjectList();
     var duration = (DateTime.Now - depart).TotalSeconds;
     Console.WriteLine(string.Format("Time spent in GetProjectList: {0} seconds.", duration));
     Assert.AreEqual(2,list.Count);
 }
        public GherkinCard Download(MingleConfiguration mingleConfiguration,
            GherkinCardConfiguration gherkinCardConfiguration)
        {
            MingleServerConfiguration serverConfig = mingleConfiguration.Server;
            MingleProjectConfiguration projectConfig = mingleConfiguration.Project;

            var credential = new MingleCredential();

            if (credential.Exists())
            {
                credential.Load();
            }
            else
            {
                credential.Prompt();
            }

            while (true)
            {
                IMingleServer server = new MingleServer(serverConfig.HostUrl, credential.Username,
                                                        credential.SecurePassword);
                MingleProject project = server.GetProject(projectConfig.Id);

                try
                {
                    MingleCard card = project.GetCard(gherkinCardConfiguration.Number);
                    var uri = new Uri(new Uri(serverConfig.HostUrl), "/projects/" + project.ProjectId + Path.ChangeExtension(card.Url, ""));

                    return new GherkinCard(card.Name, card.Description, uri.ToString());
                }
                catch (MingleWebException e)
                {
                    if (e.IsHttpUnauthorized() && !credential.Prompt())
                    {
                        throw;
                    }

                    throw;
                }
            }
        }
 internal void Initialize(string host, string login, string password)
 {
     Mingle = new MingleServer(host, login, password);
 }
 public static void MyClassInitialize(TestContext testContext)
 {
     _mingle = new MingleServer(MingleHost, MINGLEUSER, MINGLEPASSWORD);
     _project = _mingle.GetProject("apitest");
 }
 public void TestGetCards()
 {
     const string host = @"http://localhost:8080";
     const string user = "******";
     const string pw = "secret";
     var project = new MingleServer(host, user, pw).GetProject("apitest");
     Assert.AreEqual(88, project.GetCards().Count);
     Assert.AreEqual(36, project.GetCards(new Collection<string>{"[filters[]=[Type][Is][Story]"}).Count);
 }
 public void TestPostMurmur()
 {
     const string host = @"http://localhost:8080";
     const string user = "******";
     const string pw = "secret";
     var project = new MingleServer(host, user, pw).GetProject("apitest");
     var ticks = DateTime.Now.Ticks;
     Assert.AreEqual(ticks.ToString(),project.SendMurmur(ticks.ToString()).Body);
 }
 public void GetViewIntegrationTest()
 {
     var target = new MingleServer("http://localhost:8080", "mingleuser", "secret").GetProject("apitest"); 
     var actual = target.GetView("Sprint List");
     Assert.AreEqual(25, actual.Count);
 }
 public void TestTypeInFilter()
 {
     const string host = @"http://localhost:8080";
     const string user = "******";
     const string pw = "secret";
     var filters = new Collection<string> { new MingleFilter("Type", "Is", "Main Business Requirement").FilterFormatString };
     filters.Add( new MingleFilter("Type", "Is", "Business Use Case").FilterFormatString );
     filters.Add( new MingleFilter("Type", "Is", "Planning Card").FilterFormatString );
     var project = new MingleServer(host, user, pw).GetProject("bss_portfolio_sandbox");
     Assert.AreEqual(314, project.GetCards(filters).Count);
 }
 /// <summary>
 /// Sets the login credentials and creates a MingleServer object
 /// </summary>
 /// <param name="mingleHost"></param>
 /// <param name="mingleUser"></param>
 /// <param name="minglePassword"></param>
 public void SetLoginDetails(string mingleHost, string mingleUser, string minglePassword)
 {
     MingleSettings.Host = mingleHost;
     MingleSettings.Login = mingleUser;
     MingleSettings.Password = minglePassword;
     TraceLog.WriteLine(new StackFrame().GetMethod().Name, string.Format(CultureInfo.InstalledUICulture,"host={0}, login={1}", MingleSettings.Host, MingleSettings.Login));
     _mingle = new MingleServer(mingleHost, mingleUser, MingleSettings.SecurePassword);
 }
        /// <summary>
        /// Returns a sorted list of project id/name pairs in id order
        /// </summary>
        /// <returns></returns>
        internal SortedList<string, string> FetchProjects()
        {
            TraceLog.WriteLine(new StackFrame().GetMethod().Name, string.Format(CultureInfo.InstalledUICulture, "host={0}, login={1}", MingleSettings.Host, MingleSettings.Login));

            var projects = new MingleServer(MingleSettings.Host, MingleSettings.Login, MingleSettings.SecurePassword).GetProjectList();

            projects.ToList().ForEach(p => TraceLog.WriteLine(new StackFrame().GetMethod().Name, string.Format(CultureInfo.InstalledUICulture,"project: {0}",p.Key)));

            return projects;
        }