public void GetSingleError_Should_ReturnFalse_When_MemberError() { var errorsCollection = new ErrorsCollection(); errorsCollection.AddError("member", new Error("test123")); Assert.Throws <NoSingleErrorCollectionException>(() => { errorsCollection.GetSingleError(); }); }
public void GetSingleError_Should_ReturnTrue_When_SingleError() { var errorsCollection = new ErrorsCollection(); var error = new Error("test123"); errorsCollection.AddError(error); Assert.Same(error, errorsCollection.GetSingleError()); }
public void GetSingleError_Should_ReturnFalse_When_No() { var errorsCollection = new ErrorsCollection(); Assert.Throws <NoSingleErrorCollectionException>(() => { errorsCollection.GetSingleError(); }); }