Beispiel #1
0
            public void Should_InsertErrors()
            {
                var target = new ErrorsCollection();

                var scopeErrors = new ErrorsCollection();

                scopeErrors.AddError(new Error("error1"));

                var modelScope = new ModelScope <MemberClass>(c => true);

                modelScope.InsertErrors(target, scopeErrors);

                Assert.Equal("error1", target.Errors.Single().Message);
                Assert.Empty(target.Members);
            }
Beispiel #2
0
            public void Should_ThrowException_When_NullTargetCollection()
            {
                var modelScope = new ModelScope <MemberClass>(c => true);

                Assert.Throws <ArgumentNullException>(() => { modelScope.InsertErrors(null, new ErrorsCollection()); });
            }