Example #1
0
		public void GetModificationsTest()
		{
			Vsts vsts = new Vsts();
			vsts.ProjectPath = PROJECT;
			vsts.Server = SERVER;
            vsts.Username = USERNAME;
            vsts.Domain = DOMAIN;
            vsts.Password = PASSWORD;

			IIntegrationResult from = IntegrationResultMother.CreateSuccessful(DateTime.Parse("2005-01-01T00:00:00"));
			IIntegrationResult to = IntegrationResultMother.CreateSuccessful(DateTime.Today.AddDays(1));

			Modification[] actual = vsts.GetModifications(from, to);

			Assert.AreEqual(26, actual.Length, "Didn't get expected number of modifcations");
		}
Example #2
0
        public void SetUp()
        {

            CreateProcessExecutorMock("mockPath\\TF.exe");
            mockRegistry = new RegistryStub();
            historyParser = new VstsHistoryParser();

            vsts = new Vsts((ProcessExecutor)mockProcessExecutor.MockInstance, historyParser, mockRegistry);
            vsts.Username = fakeUsername;
            vsts.Password = fakePassword;
            vsts.WorkingDirectory = DefaultWorkingDirectory;
            vsts.Server = fakeTfsPath;
            vsts.ProjectPath = fakeProjectPath;

            today = DateTime.Now;
            yesterday = today.AddDays(-1);
        }
Example #3
0
		public void GetSourceTest()
		{
			Vsts vsts = new Vsts();
			vsts.ProjectPath = PROJECT;
			vsts.Server = SERVER;
            vsts.Username = USERNAME;
            vsts.Domain = DOMAIN;
            vsts.Password = PASSWORD;

			vsts.WorkingDirectory = "c:\\source\\temp";
			vsts.AutoGetSource = true;
			vsts.CleanCopy = true;

			IIntegrationResult result = IntegrationResultMother.CreateSuccessful(DateTime.Now);
			result.Label = "Test Build";

			vsts.GetSource(result);

			Assert.IsTrue(File.Exists("c:\\source\\temp\\VSTSPlugins.sln"));

		}
Example #4
0
		public void LabelTest()
		{
			Vsts vsts = new Vsts();
			vsts.ProjectPath = PROJECT;
			vsts.Server = SERVER;
            vsts.Username = USERNAME;
            vsts.Domain = DOMAIN;
            vsts.Password = PASSWORD;

            vsts.ApplyLabel = true;

			IIntegrationResult result = IntegrationResultMother.CreateSuccessful(DateTime.Now);
			result.Label = "UnitTestRun_" + DateTime.Now.Ticks.ToString();

			vsts.LabelSourceControl(result);

			Assert.IsInstanceOfType(vsts, typeof(Vsts));
		}
Example #5
0
		public void GetModificationsForServerThatDoesNotExistTest()
		{
			Vsts vsts = new Vsts();
			vsts.ProjectPath = PROJECT;
			vsts.Server = "NoneExistentServer";

			IIntegrationResult from = IntegrationResultMother.CreateSuccessful(DateTime.Parse("2005-03-10T00:00:00"));
            IIntegrationResult to = IntegrationResultMother.CreateSuccessful(DateTime.Parse("2005-10-01T00:00:00"));

			Modification[] actual = vsts.GetModifications(from, to);

			Assert.Fail("Exception Expected");
		}
Example #6
0
		public void GetModificationsForSomethingThatDoesNotExistTest()
		{
			Vsts vsts = new Vsts();
			vsts.ProjectPath = "$/FreeLunch";
			vsts.Server = SERVER;
            vsts.Username = USERNAME;
            vsts.Domain = DOMAIN;
            vsts.Password = PASSWORD;

			IIntegrationResult from = IntegrationResultMother.CreateSuccessful(DateTime.Parse("2005-03-10T00:00:00"));
            IIntegrationResult to = IntegrationResultMother.CreateSuccessful(DateTime.Parse("2005-10-01T00:00:00"));

			Modification[] actual = vsts.GetModifications(from, to);

			Assert.AreEqual(0, actual.Length);
		}