Example #1
0
        public void VoidMethodTypeIsNull()
        {
            // Arrange.
            // Act.
            IResult result = FakeService.FakeVoidMethod("test");

            // Assert.
            Assert.Null((result as Success).GetResultType());
        }
Example #2
0
        public void CallToWrongVoidMethod()
        {
            // Arrange.
            // Act.
            IResult result = FakeService.FakeVoidMethod(string.Empty);

            // Assert.
            Assert.False(result is Success);
            Assert.True(result is Error);
            Assert.False(result.IsVoid); // Is not void because it returns an exception.
        }
Example #3
0
        public void CallToOkVoidMethod()
        {
            // Arrange.
            // Act.
            IResult result = FakeService.FakeVoidMethod("Demo fake method");

            // Assert.
            Assert.True(result is Success);
            Assert.False(result is Error);
            Assert.True(result.IsVoid);
        }