Example #1
0
        public void ReflectionExtensionDisplayNameMatchesPropertyNameWhenAttributeMissing()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567
            };

            Assert.AreEqual("Blah", account.DisplayName(p => p.Blah));
        }
Example #2
0
        public void ReflectionExtensionDisplayNameGetsAttributeValue()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567
            };

            Assert.AreEqual("Account Number", account.DisplayName(p => p.AccountNumber));
        }
Example #3
0
        public void ReflectionExtensionEnumDescriptionMatchesPropertyNameWhenAttributeMissing()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567, AccountType = AccountType.Type2
            };

            Assert.AreEqual("Type2", account.AccountType.Description());
        }
Example #4
0
        public void ReflectionExtensionEnumDescriptionGetsAttributeValue()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567, AccountType = AccountType.Type1
            };

            Assert.AreEqual("The first type of account", account.AccountType.Description());
        }
Example #5
0
        public void ReflectionExtensionDescriptionBlankWhenAttributeMissing()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567
            };

            Assert.AreEqual("", account.Description(p => p.Blah));
        }
Example #6
0
        public void ReflectionExtensionDescriptionGetsAttributeValue()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567
            };

            Assert.AreEqual("The unqiue number for this account", account.Description(p => p.AccountNumber));
        }
        public void ReflectionExtensionEnumDescriptionMatchesPropertyNameWhenAttributeMissing()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567, AccountType = AccountType.Type2 };

            Assert.AreEqual("Type2", account.AccountType.Description());
        }
        public void ReflectionExtensionEnumDescriptionGetsAttributeValue()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567, AccountType = AccountType.Type1 };

            Assert.AreEqual("The first type of account", account.AccountType.Description());
        }
        public void ReflectionExtensionDisplayNameMatchesPropertyNameWhenAttributeMissing()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567 };

            Assert.AreEqual("Blah", account.DisplayName(p => p.Blah));
        }
        public void ReflectionExtensionDisplayNameGetsAttributeValue()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567 };

            Assert.AreEqual("Account Number", account.DisplayName(p => p.AccountNumber));
        }
        public void ReflectionExtensionDescriptionGetsAttributeValue()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567 };

            Assert.AreEqual("The unqiue number for this account", account.Description(p => p.AccountNumber));
        }
        public void ReflectionExtensionDescriptionBlankWhenAttributeMissing()
        {
            MockAccount account = new MockAccount() { AccountNumber = 1234567 };

            Assert.AreEqual("", account.Description(p => p.Blah));
        }