public void ShouldWriteTheAttributes()
        {
            _writer = new XmlJoinWriter(null);
            var testHelper = new XmlWriterTestHelper<JoinMapping>();
            testHelper.Check(x => x.TableName, "Table1").MapsToAttribute("table");

            testHelper.VerifyAll(_writer);
        }
        public void ShouldWriteTheKey()
        {
            var joinMapping = new JoinMapping();
            joinMapping.Key = new KeyMapping {Column = "Column1"};

            _writer = new XmlJoinWriter(null);

            _writer.VerifyXml(joinMapping)
                .Element("key").HasAttribute("column", "Column1");
        }
        public void ShouldWriteTheProperties()
        {
            var joinMapping = new JoinMapping();
            joinMapping.AddProperty(new PropertyMapping());

            var propertyDocument = new XmlDocument();
            propertyDocument.AppendChild(propertyDocument.CreateElement("property"));

            var propertyWriter = MockRepository.GenerateMock<IXmlWriter<PropertyMapping>>();
            propertyWriter
                .Expect(x => x.Write(joinMapping.Properties.First()))
                .Return(propertyDocument);

            _writer = new XmlJoinWriter(propertyWriter);

            _writer.VerifyXml(joinMapping)
                .Element("property").Exists();
        }