public void Should_write_the_attributes() { var testHelper = new HbmTestHelper<SetMapping>(); testHelper.Check(x => x.Name, "set1").MapsToAttribute("name"); testHelper.Check(x => x.OrderBy, "column1").MapsToAttribute("order-by"); testHelper.Check(x => x.IsInverse, true).MapsToAttribute("inverse"); testHelper.Check(x => x.IsLazy, true).MapsToAttribute("lazy"); var writer = new HbmSetWriter(null, null); testHelper.VerifyAll(writer); }
public void Should_produce_valid_hbm() { var set = new SetMapping { Name = "set1", Contents = new OneToManyMapping(), Key = new KeyMapping() }; var contentsWriter = MockRepository.GenerateStub<IXmlWriter<ICollectionContentsMapping>>(); contentsWriter.Expect(x => x.Write(set.Contents)).Return(new HbmOneToMany { @class = "class1" }); var keyWriter = MockRepository.GenerateStub<IXmlWriter<KeyMapping>>(); keyWriter.Expect(x => x.Write(set.Key)).Return(new HbmKey()); var writer = new HbmSetWriter(contentsWriter, keyWriter); writer.ShouldGenerateValidOutput(set); }
public void SetUp() { _mocker = new RhinoAutoMocker<HbmSetWriter>(); _writer = _mocker.ClassUnderTest; }