public void GetMethodChain_returns_chain_when_table()
        {
            var configuration = new JoinTableConfiguration { Table = "Subscriptions" };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.ToTable(\"Subscriptions\"))", configuration.GetMethodChain(code));
        }
        public void GetMethodChain_returns_chain_when_one_right_key()
        {
            var configuration = new JoinTableConfiguration { RightKeys = { "ServiceId" } };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.MapRightKey(\"ServiceId\"))", configuration.GetMethodChain(code));
        }
        public void GetMethodChain_returns_chain_when_one_left_key()
        {
            var configuration = new JoinTableConfiguration { LeftKeys = { "CustomerId" } };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.MapLeftKey(\"CustomerId\"))", configuration.GetMethodChain(code));
        }
Example #4
0
        public void GetMethodChain_returns_chain_when_table()
        {
            var configuration = new JoinTableConfiguration {
                Table = "Subscriptions"
            };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.ToTable(\"Subscriptions\"))", configuration.GetMethodChain(code));
        }
Example #5
0
        public void GetMethodChain_returns_chain_when_one_right_key()
        {
            var configuration = new JoinTableConfiguration {
                RightKeys = { "ServiceId" }
            };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.MapRightKey(\"ServiceId\"))", configuration.GetMethodChain(code));
        }
Example #6
0
        public void GetMethodChain_returns_chain_when_one_left_key()
        {
            var configuration = new JoinTableConfiguration {
                LeftKeys = { "CustomerId" }
            };
            var code = new CSharpCodeHelper();

            Assert.Equal(".Map(m => m.MapLeftKey(\"CustomerId\"))", configuration.GetMethodChain(code));
        }
Example #7
0
        public void GetMethodChain_returns_chain_when_all()
        {
            var configuration = new JoinTableConfiguration
            {
                Table     = "Subscriptions",
                LeftKeys  = { "CustomerId" },
                RightKeys = { "ServiceId" }
            };
            var code = new CSharpCodeHelper();

            Assert.Equal(
                ".Map(m => m.ToTable(\"Subscriptions\").MapLeftKey(\"CustomerId\").MapRightKey(\"ServiceId\"))",
                configuration.GetMethodChain(code));
        }
        public void GetMethodChain_returns_chain_when_all()
        {
            var configuration = new JoinTableConfiguration
                {
                    Table = "Subscriptions",
                    LeftKeys = { "CustomerId" },
                    RightKeys = { "ServiceId" }
                };
            var code = new CSharpCodeHelper();

            Assert.Equal(
                ".Map(m => m.ToTable(\"Subscriptions\").MapLeftKey(\"CustomerId\").MapRightKey(\"ServiceId\"))",
                configuration.GetMethodChain(code));
        }