Esempio n. 1
0
        public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenAttemptingToAccessTheErrorPropertyThrows()
        {
            var testData = new TestSuccessClass();
            var result   = Result <TestSuccessClass, TestErrorClass> .Success(testData);

            Assert.Throws <InvalidOperationException>(() => result.Error);
        }
Esempio n. 2
0
        public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenIsSuccessPropertyIsTrue()
        {
            var testData = new TestSuccessClass();
            var result   = Result <TestSuccessClass, TestErrorClass> .Success(testData);

            result.IsSuccess.Should().BeTrue();
        }
Esempio n. 3
0
        public void GivenAValidSuccessObject_WhenSuccessIsInvoked_ThenValueIsTheSameAsSuccessObject()
        {
            var testData = new TestSuccessClass();
            var result   = Result <TestSuccessClass, TestErrorClass> .Success(testData);

            result.Value.Should().Be(testData);
        }