aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.HardwareVersionComparison/App.config
blob: 731f6de6c291e303814b02808f34140fe560e8e4 (plain)
1
2
3
4
5
6
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
</configuration>
0; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Helpers;
using Tango.Core.IO;
using Tango.TFS;

namespace Tango.UnitTesting
{
    [TestClass]
    [TestCategory("Team Foundation Service")]
    public class TFS_TST
    {
        private ITeamFoundationServiceClient CreateClient()
        {
            ITeamFoundationServiceClient client = new TeamFoundationServiceClient(

                                                  "https://twinetfs.visualstudio.com/DefaultCollection",
                                                  "Roy",
                                                  "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa");
            return client;
        }

        [TestMethod]
        public void Get_Tango_Project()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);
        }

        [TestMethod]
        public void Get_Work_Item()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);

            var workItem = client.GetWorkItem(project, 168).Result;

            Assert.IsNotNull(workItem);
        }

        [TestMethod]
        public void Get_Work_Items_Created_By()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);

            var workItems = client.GetWorkItemsCreatedBy(project, project.Members.SingleOrDefault(x => x.AssignName.ToLower().Contains("roy"))).Result;

            Assert.IsTrue(workItems.Count > 0);
        }

        [TestMethod]
        public void Set_Work_Item_State()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);

            var workItem = client.GetWorkItem(project, 164).Result;

            Assert.IsNotNull(workItem);

            var updated = client.SetWorkItemState(project, workItem, State.Active).Result;

            Assert.IsTrue(updated.State == State.Active);
        }

        [TestMethod]
        public void Add_Work_Item_Comment()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);

            var workItem = client.GetWorkItem(project, 165).Result;

            Assert.IsNotNull(workItem);

            var updated = client.AddWorkItemComment(project, workItem, project.Members.SingleOrDefault(x => x.AssignName.ToLower().Contains("roy")), "Test Comment").Result;

            Assert.AreEqual(updated.Comment, "Test Comment");
        }

        [TestMethod]
        public void Upload_Work_Item()
        {
            ITeamFoundationServiceClient client = CreateClient();

            var project = client.GetProject("Tango").Result;

            Assert.IsNotNull(project);

            WorkItem item = new WorkItem();
            item.Area = project.Areas.First();
            item.AssignedTo = project.Members.Single(x => x.DisplayName.Contains("Roy"));
            item.CreatedBy = project.Members.Single(x => x.DisplayName.Contains("Shlomo"));
            item.ChangedBy = project.Members.Single(x => x.DisplayName.Contains("Shlomo"));
            item.AuthorizedAs = project.Members.Single(x => x.DisplayName.Contains("Shlomo"));

            var tempFile = TemporaryManager.Default.CreateFile();
            File.AppendAllText(tempFile.Path, "This is a test text file...");

            item.Attachments.Add(new Attachment()
            {
                Description = "Test Attachment",
                FilePath = tempFile.Path,
                Name = "TestDocument.txt"
            });

            item.Description = "This is a test description";
            item.FoundInBuild = "1.0.0.9";
            item.Iteration = project.Iterations.First();
            item.Priority = Priority.Priority3;
            item.Severity = Severity.Medium;
            item.State = State.New;
            item.StepsToReproduce = "Step 1" + Environment.NewLine + "Step 2";
            item.SystemInformation = "This is the system information";
            item.Tags.Add(project.Tags.First());
            item.Title = "Test Bug";
            item.Type = WorkItemType.Bug;

            var workItem = client.UploadWorkItem(project, item).Result;

            Assert.IsNotNull(workItem);
        }
    }
}