Example #1
0
        public void BuildTask_InvalidRuleType_Throws()
        {
            TestableVersioningTask sut = new TestableVersioningTask();
            string verItemsSimple      = "**/assemblyinfo.cs;ASSXXEMBLY";

            Assert.Throws <InvalidOperationException>(() => { sut.SetAllVersioningItems(verItemsSimple); });
        }
Example #2
0
        public void BuildTask_PassInRules_Works()
        {
            var v = GetDefaultVersion();
            TestableVersioningTask sut = new TestableVersioningTask();

            sut.SetVersionNumber(v);
            string verItemsSimple = "**/assemblyinfo.cs!ASSEMBLY";

            sut.SetAllVersioningItems(verItemsSimple);

            Assert.True(sut.IsThisMinimatchIncluded("**/assemblyinfo.cs"), "The minimatch was not included");
        }
Example #3
0
        public void BuildTask_PassInMultipleRules_Works()
        {
            var v = GetDefaultVersion();
            TestableVersioningTask sut = new TestableVersioningTask();

            sut.SetVersionNumber(v);
            string verItemsSimple = $"**/assemblyinfo.cs!ASSEMBLY{Environment.NewLine}xxMonkey!FILE{Environment.NewLine}yyzzxxbannana!WIX{Environment.NewLine}";

            sut.SetAllVersioningItems(verItemsSimple);

            Assert.True(sut.IsThisMinimatchIncluded("**/assemblyinfo.cs"), "The minimatch was not included");
            Assert.True(sut.IsThisMinimatchIncluded("xxMonkey"), "The second minimatch was not included");
            Assert.True(sut.IsThisMinimatchIncluded("yyzzxxbannana"), "The third minimatch was not included");
        }