Esempio n. 1
0
        public void TestCreateNew()
        {
            UnitTestContext context = GetContext();

            MockEditableRoot.CreateNew((o, e) =>
            {
                MockEditableRoot actual = e.Object;
                context.Assert.IsNull(e.Error);
                context.Assert.IsNotNull(actual);
                context.Assert.AreEqual(MockEditableRoot.MockEditableRootId, actual.Id);
                context.Assert.IsTrue(actual.IsNew);
                context.Assert.IsTrue(actual.IsDirty);
                context.Assert.IsFalse(actual.IsDeleted);
                context.Assert.AreEqual("create", actual.DataPortalMethod);
                context.Assert.Success();
            });

            context.Complete();
        }
Esempio n. 2
0
        public void When_CreateNew_Returns_EditableRoot_Then_returned_object_is_Marked_New_Dirty_and_NotDeleted()
        {
            var context = GetContext();

            MockEditableRoot.CreateNew((o, e) =>
            {
                var actual = (MockEditableRoot)e.Object;
                context.Assert.IsNull(e.Error);
                context.Assert.IsNotNull(actual);
                context.Assert.AreEqual(MockEditableRoot.MockEditableRootId, actual.Id);
                context.Assert.IsTrue(actual.IsNew);
                context.Assert.IsTrue(actual.IsDirty);
                context.Assert.IsFalse(actual.IsDeleted);
                context.Assert.AreEqual("create", actual.DataPortalMethod);
                context.Assert.Success();
            });

            context.Complete();
        }