コード例 #1
0
            public void GetSingleError_Should_ReturnFalse_When_MemberError()
            {
                var errorsCollection = new ErrorsCollection();

                errorsCollection.AddError("member", new Error("test123"));

                Assert.Throws <NoSingleErrorCollectionException>(() => { errorsCollection.GetSingleError(); });
            }
コード例 #2
0
            public void GetSingleError_Should_ReturnTrue_When_SingleError()
            {
                var errorsCollection = new ErrorsCollection();

                var error = new Error("test123");

                errorsCollection.AddError(error);

                Assert.Same(error, errorsCollection.GetSingleError());
            }
コード例 #3
0
            public void GetSingleError_Should_ReturnFalse_When_No()
            {
                var errorsCollection = new ErrorsCollection();

                Assert.Throws <NoSingleErrorCollectionException>(() => { errorsCollection.GetSingleError(); });
            }