This fixture creates a set of Kunden, Projekte, Mitarbeiter and Tasks for testing.
Inheritance: AbstractTestFixture
Esempio n. 1
0
 public override void TearDown()
 {
     using (var ctx = GetContext())
     {
         ctx.GetQuery <TestObjClass>().ForEach(obj => { obj.ObjectProp = null; ctx.Delete(obj); });
         ProjectDataFixture.DeleteData(ctx);
         ctx.SubmitChanges();
     }
     base.TearDown();
 }
Esempio n. 2
0
        public override void SetUp()
        {
            base.SetUp();
            iftFactory = scope.Resolve <InterfaceType.Factory>();

            using (IZetboxContext ctx = GetContext())
            {
                ctx.GetQuery <TestObjClass>().ForEach(obj => { obj.ObjectProp = null; ctx.Delete(obj); });
                ProjectDataFixture.DeleteData(ctx);
                ctx.SubmitChanges();
            }

            using (IZetboxContext ctx = GetContext())
            {
                var list = new List <TestObjClass>();
                while (list.Count < 2)
                {
                    var newObj = ctx.Create <TestObjClass>();
                    newObj.ObjectProp = null; // kunde;
                    newObj.StringProp = "blah" + list.Count;
                    list.Add(newObj);
                }

                ctx.SubmitChanges();

                firstId              = list[0].ID;
                list[0].StringProp   = "First";
                list[0].TestEnumProp = TestEnum.First;

                secondId             = list[1].ID;
                list[1].StringProp   = "Second";
                list[1].TestEnumProp = TestEnum.Second;

                ctx.SubmitChanges();
            }
        }