Beispiel #1
0
        public void GetKeySelector()
        {
            if (ConfigurationManager.AppSettings["Environment"] == "Test")
                Assert.Ignore("Skipped on AppHarbor");

            var explicitKey = new TestObjectWithExplicitKey { ID = "myKey" };
            var explicitKeySelector = new TestContext().GetKeySelector<TestObjectWithExplicitKey>();
            CollectionAssert.AreEquivalent(new[] { explicitKey.ID }, explicitKeySelector(explicitKey));

            var conventionKey = new TestObjectWithConventionKey { ID = "myKey2" };
            var conventionKeySelector = new TestContext().GetKeySelector<TestObjectWithConventionKey>();
            CollectionAssert.AreEquivalent(new[] { conventionKey.ID }, conventionKeySelector(conventionKey));
        }
Beispiel #2
0
        public void GetKeySelector()
        {
            if (ConfigurationManager.AppSettings["Environment"] == "Test")
            {
                Assert.Ignore("Skipped on AppHarbor");
            }

            var explicitKey = new TestObjectWithExplicitKey {
                ID = "myKey"
            };
            var explicitKeySelector = new TestContext().GetKeySelector <TestObjectWithExplicitKey>();

            CollectionAssert.AreEquivalent(new[] { explicitKey.ID }, explicitKeySelector(explicitKey));

            var conventionKey = new TestObjectWithConventionKey {
                ID = "myKey2"
            };
            var conventionKeySelector = new TestContext().GetKeySelector <TestObjectWithConventionKey>();

            CollectionAssert.AreEquivalent(new[] { conventionKey.ID }, conventionKeySelector(conventionKey));
        }