public Task DoNothingWhenCorrectArgumentNullExceptionThrown(
            [Frozen] Mock<IExecutionSetup> executionSetupMock,
            MethodData method)
        {
            // Arrange
            executionSetupMock
                .Setup(es => es.Setup(method))
                .Returns(() => ExceptionTask(new ArgumentNullException(method.NullParameter)));

            // Act
            return method.Execute();
        }
        public Task DoNothingWhenCorrectArgumentNullExceptionThrown(
            [Frozen] Mock <IExecutionSetup> executionSetupMock,
            MethodData method)
        {
            // Arrange
            executionSetupMock
            .Setup(es => es.Setup(method))
            .Returns(() => ExceptionTask(new ArgumentNullException(method.NullParameter)));

            // Act
            return(method.Execute());
        }
        public void ThrowIfWrongExceptionThrown(
            [Frozen] Mock<IExecutionSetup> executionSetupMock,
            MethodData method)
        {
            // Arrange
            executionSetupMock
                .Setup(es => es.Setup(method))
                .Returns(() => ExceptionTask(new Exception(method.ToString())));

            // Act/Assert
            Exception innerException = Assert.Throws<AggregateException>(() => method.Execute().Wait()).InnerException;
            Assert.IsType<ThrowsException>(innerException);
        }
        public async Task ExplicitEquals(MethodData method)
        {
            await method.Execute();

            if (method.NullParameter == "stringValue1")
                Assert.True(Issues.Issue015.ExplicitEquals.TestedStringValue1);

            if (method.NullParameter == "stringValue2")
                Assert.True(Issues.Issue015.ExplicitEquals.TestedStringValue2);

            if (method.NullParameter == "stringValue3")
                Assert.True(Issues.Issue015.ExplicitEquals.TestedStringValue3);
        }
        public void ThrowIfWrongArgumentNullExceptionThrown(
            [Frozen] Mock <IExecutionSetup> executionSetupMock,
            MethodData method)
        {
            // Arrange
            executionSetupMock
            .Setup(es => es.Setup(method))
            .Returns(() => ExceptionTask(new ArgumentNullException(Guid.NewGuid().ToString())));

            // Act/Assert
            Exception innerException = Assert.Throws <AggregateException>(() => method.Execute().Wait()).InnerException;

            Assert.IsType <EqualException>(innerException);
        }
        public void ThrowIfNoExceptionThrown(
            [Frozen] Mock <IExecutionSetup> executionSetupMock,
            MethodData method)
        {
            // Arrange
            executionSetupMock
            .Setup(es => es.Setup(method))
            .Returns(() => CompletedTask());

            // Act/Assert
            Exception innerException = Assert.Throws <AggregateException>(() => method.Execute().Wait()).InnerException;

            Assert.IsType <ThrowsException>(innerException);
        }
        public async Task Simple(MethodData method)
        {
            await method.Execute();

            Assert.True(SimpleGenericMethods.GenericMethod2Tested);
        }
        public async Task TestStringRef(MethodData method)
        {
            await method.Execute();

            Assert.True(SomeOutParameters.StringRefTested);
        }
        public async Task TestStringInput(MethodData method)
        {
            await method.Execute();

            Assert.True(SomeNullableValueTypeParameters.StringInputTested);
        }
        public async Task ComplexGenericExceptionMethodStringValue(MethodData method)
        {
            await method.Execute();

            Assert.True(ComplexGenericMethods.GenericExceptionMethodStringValueTested);
        }
        public async Task TestNullArguments(MethodData method)
        {
            await method.Execute();

            Assert.True(YieldExample.Tested);
        }
Beispiel #12
0
 public Task TestAllNullArgumentsXunit(MethodData method)
 {
     return(method.Execute());
 }
        public async Task TestNullArguments(MethodData method)
        {
            await method.Execute();

            Assert.True(SpecialCharacters.Tested);
        }
        public async Task SimpleException(MethodData method)
        {
            await method.Execute();

            Assert.True(SimpleGenericMethods.GenericExceptionMethodTested);
        }
 public async Task TestGenericClass(MethodData method)
 {
     await method.Execute();
     Assert.True(GenericClass<Version>.Tested);
 }
        public async Task ComplexClassValue(MethodData method)
        {
            await method.Execute();

            Assert.True(ComplexGenericMethods.ClassValueTested);
        }
        public async Task InterfaceStringValue(MethodData method)
        {
            await method.Execute();

            Assert.True(InterfaceGenericMethods.StringValueTested);
        }
        public async Task MixedStringValue(MethodData method)
        {
            await method.Execute();

            Assert.True(MixedGenericMethods.StringValueTested);
        }
 public Task TestAllNullArguments(MethodData method)
 {
     return method.Execute();
 }
        public async Task ImplicitEquals(MethodData method)
        {
            await method.Execute();

            Assert.True(Issues.Issue015.ImplicitEquals.Tested);
        }
 public Task CloudFlare(MethodData method)
 {
     return method.Execute();
 }
 public async Task OnlyTestPublic(MethodData method)
 {
     await method.Execute();
     Assert.True(Mixture.Tested);
 }