コード例 #1
0
        public void WhenDecoratedStrings_FormatsProperly()
        {
            var attribute = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(DecoratedStringsProperty);
            var actual    = ArgumentsBuilderExtension.GetArgumentFromAutoProperty(attribute, DecoratedStringsProperty, new string[] { "One=1", "Two=2" });

            Assert.That(actual, Is.EqualTo("-e One=1 -e Two=2"));
        }
コード例 #2
0
        public void WhenOnlyWhenTrueValue_AndIsTrue_FormatsProperly()
        {
            var attribute = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(DecoratedBoolProperty);
            var actual    = ArgumentsBuilderExtension.GetArgumentFromAutoProperty(attribute, DecoratedBoolProperty, true);

            Assert.That(actual, Is.EqualTo("-v"));
        }
コード例 #3
0
        public void WhenOnlyWhenTrueValue_AndIsFalse_ReturnsEmptyString()
        {
            var attribute = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(DecoratedBoolProperty);
            var actual    = ArgumentsBuilderExtension.GetArgumentFromAutoProperty(attribute, DecoratedBoolProperty, false);

            Assert.That(actual, Is.Empty);
        }
コード例 #4
0
        public void WhenGivenValue_FormatsProperly()
        {
            var attribute = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(DecoratedStringProperty);
            var actual    = ArgumentsBuilderExtension.GetArgumentFromAutoProperty(attribute, DecoratedStringProperty, "SIGNAL");

            Assert.That(actual, Is.EqualTo("-s SIGNAL"));
        }
コード例 #5
0
        public void WhenNotDecorated_ReturnsNull()
        {
            var actual = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(StringProperty);

            Assert.That(actual, Is.Null);
        }
コード例 #6
0
        public void WhenDecorated_ReturnsAutoPropertyAttribute()
        {
            var actual = ArgumentsBuilderExtension.GetAutoPropertyAttributeOrNull(DecoratedStringProperty);

            Assert.That(actual.Format, Is.EqualTo("-s {1}"));
        }