public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenAttemptingToAccessTheErrorPropertyThrows() { var testData = new TestSuccessClass(); var result = Result <TestSuccessClass, TestErrorClass> .Success(testData); Assert.Throws <InvalidOperationException>(() => result.Error); }
public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenIsSuccessPropertyIsTrue() { var testData = new TestSuccessClass(); var result = Result <TestSuccessClass, TestErrorClass> .Success(testData); result.IsSuccess.Should().BeTrue(); }
public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenValueIsTheSameAsSuccessObject() { var testData = new TestSuccessClass(); var result = Result <TestSuccessClass, TestErrorClass> .Success(testData); result.Value.Should().Be(testData); }