Exemplo n.º 1
0
        public void A()
        {
            Execute(session =>
                        {
                            var item = new ClassWithDescribedEnum {Colour = Colours.Blue, Id = 1};
                            session.Save(item);
                        }
                );

            var colourDesc = ExecuteAndExtractFirstFromReader("SELECT Colour FROM ClassWithDescribedEnum WHERE Id = 1",
                                                              reader => reader.GetString(0));

            Assert.That(colourDesc, Is.EqualTo("B"));
        }
Exemplo n.º 2
0
        public void B()
        {
            Execute(session =>
                        {
                            var newItem = new ClassWithDescribedEnum { Colour = Colours.Blue, Id = 1 };
                            session.Save(newItem);
                        }
                );

            ClassWithDescribedEnum item = null;

            Execute(session => item = session.Load<ClassWithDescribedEnum>(1));

            Assert.That(item.Colour, Is.EqualTo(Colours.Blue));
        }