Ejemplo n.º 1
0
        public void ReflectionExtensionDisplayNameMatchesPropertyNameWhenAttributeMissing()
        {
            MockAccount account = new MockAccount()
            {
                AccountNumber = 1234567
            };

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

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

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

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

            Assert.AreEqual("", account.Description(p => p.Blah));
        }
Ejemplo n.º 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));
        }