コード例 #1
0
ファイル: EditBaseTests.cs プロジェクト: keithdv/OOBehave
        public void TestInitialize()
        {
            scope = AutofacContainer.GetLifetimeScope();

            editPerson = scope.Resolve <IEditPerson>();
            var parentDto = scope.Resolve <IReadOnlyList <PersonDto> >().Where(p => !p.FatherId.HasValue && !p.MotherId.HasValue).First();

            editPerson.FillFromDto(parentDto);
            editPerson.MarkOld();
            editPerson.MarkUnmodified();
            Assert.IsFalse(editPerson.IsModified);
            Assert.IsFalse(editPerson.IsNew);
            Assert.IsFalse(editPerson.IsSavable);
        }
コード例 #2
0
        public void TestInitialize()
        {
            scope = AutofacContainer.GetLifetimeScope();
            var parentDto = scope.Resolve <IReadOnlyList <PersonDto> >().Where(p => !p.FatherId.HasValue && !p.MotherId.HasValue).First();

            list = scope.Resolve <IEditPersonList>();
            list.FillFromDto(parentDto);
            list.MarkUnmodified();
            list.MarkOld();

            child = scope.Resolve <IEditPerson>();
            child.MarkUnmodified();
            child.MarkOld();
            child.MarkAsChild();
            list.Add(child);

            Assert.IsFalse(list.IsBusy);
        }
コード例 #3
0
        public void TestInitialize()
        {
            scope = AutofacContainer.GetLifetimeScope();
            var persons = scope.Resolve <IReadOnlyList <PersonDto> >();



            parent = scope.Resolve <IEditPerson>();
            parent.FillFromDto(persons.Where(p => !p.FatherId.HasValue && !p.MotherId.HasValue).First());

            child = scope.Resolve <IEditPerson>();
            child.FillFromDto(persons.Where(p => p.FatherId == parent.Id).First());
            parent.Child = child;

            child.MarkOld();
            child.MarkUnmodified();
            child.MarkAsChild();
            parent.MarkOld();
            parent.MarkUnmodified();
        }