public void ShouldMatchOriginalQualityWhenNullInConfigButEmptyInTfs()
        {
            const string TestNewQuality = "Pass";

            var changeEvent = new BuildStatusChangeEvent();

            var mapping = new Mapping
            {
                Computer        = Environment.MachineName,
                NewQuality      = TestNewQuality,
                PermittedUsers  = null,
                OriginalQuality = null
            };

            changeEvent.StatusChange = new Change
            {
                NewValue = TestNewQuality,
                OldValue = string.Empty
            };

            var mappingEvaluator = new MappingEvaluator();
            var result           = mappingEvaluator.DoesMappingApply(mapping, changeEvent, BuildStatus.Succeeded.ToString());

            Assert.IsTrue(result);
        }
        public void ShouldRejectUnchangedQuality()
        {
            const string TestWildcard = "*";

            var changeEvent = new BuildStatusChangeEvent();

            var mapping = new Mapping
            {
                Computer        = Environment.MachineName,
                NewQuality      = "SomeNewQuality",
                PermittedUsers  = null,
                OriginalQuality = TestWildcard
            };

            changeEvent.StatusChange = new Change
            {
                NewValue = "SomeNewQuality",
                OldValue = "SomeNewQuality"
            };

            var mappingEvaluator = new MappingEvaluator();
            var result           = mappingEvaluator.DoesMappingApply(mapping, changeEvent, BuildStatus.Succeeded.ToString());

            Assert.IsFalse(result);
        }
Exemple #3
0
        private bool DoesMappingApply(string buildStatus)
        {
            var mappingEvaluator = new MappingEvaluator();

            return(mappingEvaluator.DoesMappingApply(SimpleMapping, SimpleChangeEvent, buildStatus));
        }
Exemple #4
0
        private bool DoesMappingApply(string buildStatus)
        {
            var mappingEvaluator = new MappingEvaluator();

            return(mappingEvaluator.DoesMappingApply(new MappingBuilder().Mapping, new BuildStatusChangeEventBuilder().BuildStatusChangeEvent, buildStatus));
        }