Пример #1
0
        public static TestProperty GetProperty(string name)
        {
            TestUtils.IsNotNull(_testPropertyCollection,
                                new TestPropertiesNotInitializedException("The TestProperties collection must be initialized before use."));
            TestUtils.IsFalse(string.IsNullOrEmpty(name), new TestPropertyNameException("The test property name cannot be a null or empty string."));

            TestProperty testProperty;

            switch (name.ToUpper())
            {
            case "NULL":
                testProperty = new TestSystemProperty("NULL", "Null value", null, true);
                break;

            case "EMPTYSTRING":
                testProperty = new TestSystemProperty("EMPTYSTRING", "Empty string value", string.Empty, true);
                break;

            case "SPACE":
                testProperty = new TestSystemProperty("SPACE", "Space character value", " ", true);
                break;

            case "NOW":
                testProperty = new TestSystemProperty("NOW", "Current date time value", DateTime.Now, true);
                break;

            case "TODAY":
                testProperty = new TestSystemProperty("TODAY", "Current date value", DateTime.Today, true);
                break;

            default:
                _testPropertyCollection.TryGetValue(name, out testProperty);
                break;
            }

            return(testProperty);
        }
 public TestSystemProperty(TestSystemProperty testSystemProperty)
     : base(testSystemProperty)
 {
 }