Exemple #1
0
 public void Properties_GivenValue_ShouldSetPropertyValue(string propertyName)
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     PropertyTestHelper.ValidateGetAndSet <HeliumRequest>(propertyName);
     //---------------Test Result -----------------------
 }
Exemple #2
0
 public void Properties_GivenValue_ShouldSetPropertyValue(string propertyName)
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     PropertyTestHelper.ValidateGetAndSet <ThuriaRelationshipAttribute>(propertyName);
     //---------------Test Result -----------------------
 }
 public void Property_GivenValue_ShouldSetPropertyValue(string propertyName)
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     PropertyTestHelper.ValidateGetAndSet <ThuriaCacheData <string> >(propertyName);
     //---------------Test Result -----------------------
 }
 public void Properties_GivenValue_ShouldSetParameterValue(string propertyName)
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     PropertyTestHelper.ValidateGetAndSet <SqlDatabaseContext>(propertyName);
     //---------------Test Result -----------------------
 }
Exemple #5
0
 public void ValidateDecoratedWithAttribute_GivenPropertyDecorated_ShouldPassTest(string propertyName, Type attributeType)
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     Assert.DoesNotThrow(() => PropertyTestHelper.ValidateDecoratedWithAttribute <FakeTestClass>(propertyName, attributeType));
     //---------------Test Result -----------------------
 }
Exemple #6
0
        public void ValidateDecoratedWithAttribute_GivenPropertyNotDecorated_ShouldFailTest(string propertyName, Type attributeType)
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var exception = Assert.Throws <AssertionException>(() => PropertyTestHelper.ValidateDecoratedWithAttribute <FakeTestClass>(propertyName, attributeType));

            //---------------Test Result -----------------------
            exception.Message.Contains($"Property {propertyName} is not decorated with {attributeType.Name} Attribute");
        }
Exemple #7
0
 public void ValidateDecoratedWithAttribute_GivenPropertyDecoratedWithAttributeWithExpectedParameters_ShouldPassTest()
 {
     //---------------Set up test pack-------------------
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     Assert.DoesNotThrow(() => PropertyTestHelper.ValidateDecoratedWithAttribute <FakeTestClass>("TestDictionary",
                                                                                                 typeof(FakeTestAttribute),
                                                                                                 new List <(string propertyName, object propertyValue)>
     {
         ("PropertyName", "TestDictionary"),
         ("Sequence", 23)
     }));
     //---------------Test Result -----------------------
 }
Exemple #8
0
        public void ValidateDecoratedWithAttribute_GivenPropertyDecoratedWithAttributeButPropertyValueIsNotExpected_ShouldFailTest()
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var exception = Assert.Throws <AssertionException>(() => PropertyTestHelper.ValidateDecoratedWithAttribute <FakeTestClass>("TestDictionary",
                                                                                                                                       typeof(FakeTestAttribute),
                                                                                                                                       new List <(string propertyName, object propertyValue)>
            {
                ("PropertyName", "TestDictionary"),
                ("Sequence", 55)
            }));

            //---------------Test Result -----------------------
            exception.Message.Should().Contain("TestDictionary Property is decorated with FakeTestAttribute " +
                                               "but the attribute property Sequence is not set to 55");
        }