├── .gitattributes
├── .gitignore
├── README.md
├── build.ps1
├── help
└── xunit.shfb
├── license.txt
├── nuget.config
├── samples
├── AssertExamples
│ ├── AssertExamples.csproj
│ ├── AsyncExamples.cs
│ ├── CollectionExample.cs
│ ├── EqualExample.cs
│ └── packages.config
├── AssertExtensions
│ ├── AssertExtensions.csproj
│ ├── BooleanAssertionExtensions.cs
│ ├── CollectionAssertionExtensions.cs
│ ├── ExampleFacts.cs
│ ├── ObjectAssertExtensions.cs
│ ├── StringAssertionExtensions.cs
│ └── packages.config
├── AssumeIdentity
│ ├── AssumeIdentity.csproj
│ ├── AssumeIdentityAttribute.cs
│ ├── AssumeIdentityAttributeTests.cs
│ └── packages.config
├── ClassFixtureExample
│ ├── App.config
│ ├── ClassFixtureExample.csproj
│ ├── ClassFixtureTests.cs
│ ├── DatabaseFixture.cs
│ ├── DatabaseFixture.mdf
│ ├── DatabaseFixture_log.LDF
│ └── packages.config
├── CollectionFixtureExample
│ ├── CollectionFixtureExample.csproj
│ ├── ConnectionFacts.cs
│ ├── DatabaseCollection.cs
│ ├── DatabaseFixture.cs
│ ├── DatabaseFixture.mdf
│ ├── DatabaseFixture_log.ldf
│ ├── InsertTests.cs
│ ├── app.config
│ └── packages.config
├── ExcelDataExample
│ ├── AcceptanceTestData.xls
│ ├── ExcelDataAttribute.cs
│ ├── ExcelDataExample.csproj
│ ├── ExcelDataExamples.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── UnitTestData.xls
│ └── packages.config
├── GlobalAssemblyInfo.cs
├── Samples.sln
├── SpecificationExamples
│ ├── SpecificationBaseStyle
│ │ ├── ObservationAttribute.cs
│ │ ├── SpecificationBase.cs
│ │ └── SpecificationBaseRunner.cs
│ ├── SpecificationExamples.csproj
│ ├── Stack.cs
│ ├── StackSpecificationBaseExample.cs
│ ├── StackSubSpecExample.cs
│ ├── SubSpec
│ │ ├── ExceptionTestCommand.cs
│ │ ├── SpecificationAttribute.cs
│ │ ├── SpecificationContext.cs
│ │ └── SpecificationExtensions.cs
│ └── packages.config
├── Stack
│ ├── Stack.cs
│ ├── Stack.csproj
│ ├── StackTests.cs
│ └── packages.config
├── TestOrderExamples
│ ├── AlphabeticalOrderExample.cs
│ ├── AlphabeticalOrderer.cs
│ ├── PriorityOrderExamples.cs
│ ├── PriorityOrderer.cs
│ ├── TestOrderExamples.csproj
│ ├── TestPriorityAttribute.cs
│ └── packages.config
├── TracingExample
│ ├── Example.cs
│ ├── TracingExample.csproj
│ ├── TracingSplicerAttribute.cs
│ └── packages.config
├── TraitExtensibility
│ ├── CategoryAttribute.cs
│ ├── CategoryDiscoverer.cs
│ ├── Example.cs
│ ├── TraitExtensibility.csproj
│ └── packages.config
└── UseCulture
│ ├── UseCulture.csproj
│ ├── UseCultureAttribute.cs
│ ├── UseCultureAttributeTests.cs
│ └── packages.config
├── src
├── CodeAnalysisDictionary.xml
├── common
│ ├── Application.ico
│ ├── AssemblyExtensions.cs
│ ├── DictionaryExtensions.cs
│ ├── DisposableExtensions.cs
│ ├── ExceptionExtensions.cs
│ ├── GlobalAssemblyInfo.cs
│ ├── Guard.cs
│ ├── SerializationInfoExtensions.cs
│ ├── SourceInformation.cs
│ ├── TestDiscoveryVisitor.cs
│ ├── TestOptionsNames.cs
│ └── XmlTestExecutionVisitor.cs
├── signing.snk
├── xunit.abstractions.net35
│ └── xunit.abstractions.net35.csproj
├── xunit.abstractions.nuspec
├── xunit.abstractions.pcl
│ └── xunit.abstractions.pcl.csproj
├── xunit.abstractions
│ ├── Frameworks
│ │ ├── ISourceInformation.cs
│ │ ├── ISourceInformationProvider.cs
│ │ ├── ITestFramework.cs
│ │ ├── ITestFrameworkDiscoverer.cs
│ │ ├── ITestFrameworkExecutor.cs
│ │ └── ITestFrameworkOptions.cs
│ ├── GlobalSuppressions.cs
│ ├── Messages
│ │ ├── BaseInterfaces
│ │ │ ├── IFinishedMessage.cs
│ │ │ ├── IMessageSink.cs
│ │ │ ├── IMessageSinkMessage.cs
│ │ │ ├── ITestCaseMessage.cs
│ │ │ ├── ITestClassMessage.cs
│ │ │ ├── ITestCollectionMessage.cs
│ │ │ ├── ITestMessage.cs
│ │ │ └── ITestResultMessage.cs
│ │ ├── IAfterTestFinished.cs
│ │ ├── IAfterTestStarting.cs
│ │ ├── IBeforeTestFinished.cs
│ │ ├── IBeforeTestStarting.cs
│ │ ├── IDiscoveryCompleteMessage.cs
│ │ ├── IErrorMessage.cs
│ │ ├── IFailureInformation.cs
│ │ ├── ITestAssemblyFinished.cs
│ │ ├── ITestAssemblyStarting.cs
│ │ ├── ITestCaseDiscoveryMessage.cs
│ │ ├── ITestCaseFinished.cs
│ │ ├── ITestCaseStarting.cs
│ │ ├── ITestClassConstructionFinished.cs
│ │ ├── ITestClassConstructionStarting.cs
│ │ ├── ITestClassDisposeFinished.cs
│ │ ├── ITestClassDisposeStarting.cs
│ │ ├── ITestClassFinished.cs
│ │ ├── ITestClassStarting.cs
│ │ ├── ITestCollectionFinished.cs
│ │ ├── ITestCollectionStarting.cs
│ │ ├── ITestFailed.cs
│ │ ├── ITestFinished.cs
│ │ ├── ITestMethodFinished.cs
│ │ ├── ITestMethodStarting.cs
│ │ ├── ITestPassed.cs
│ │ ├── ITestSkipped.cs
│ │ └── ITestStarting.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Reflection
│ │ ├── IAssemblyInfo.cs
│ │ ├── IAttributeInfo.cs
│ │ ├── IMethodInfo.cs
│ │ ├── IParameterInfo.cs
│ │ ├── IReflectionAssemblyInfo.cs
│ │ ├── IReflectionAttributeInfo.cs
│ │ ├── IReflectionMethodInfo.cs
│ │ ├── IReflectionParameterInfo.cs
│ │ ├── IReflectionTypeInfo.cs
│ │ └── ITypeInfo.cs
│ ├── TestCases
│ │ ├── ITestCase.cs
│ │ └── ITestCollection.cs
│ ├── xunit.abstractions.projitems
│ └── xunit.abstractions.shproj
├── xunit.assert.source.nuspec
├── xunit.assert
│ ├── Asserts
│ │ ├── Assert.cs
│ │ ├── BooleanAsserts.cs
│ │ ├── CollectionAsserts.cs
│ │ ├── Comparers.cs
│ │ ├── EqualityAsserts.cs
│ │ ├── ExceptionAsserts.cs
│ │ ├── Guards.cs
│ │ ├── IdentityAsserts.cs
│ │ ├── NullAsserts.cs
│ │ ├── PropertyAsserts.cs
│ │ ├── RangeAsserts.cs
│ │ ├── Record.cs
│ │ ├── Sdk
│ │ │ ├── AssertComparer.cs
│ │ │ ├── AssertEqualityComparer.cs
│ │ │ ├── AssertEqualityComparerAdapter.cs
│ │ │ └── Exceptions
│ │ │ │ ├── AssertActualExpectedException.cs
│ │ │ │ ├── AssertCollectionCountException.cs
│ │ │ │ ├── CollectionException.cs
│ │ │ │ ├── ContainsException.cs
│ │ │ │ ├── DoesNotContainException.cs
│ │ │ │ ├── DoesNotMatchException.cs
│ │ │ │ ├── DoesNotThrowException.cs
│ │ │ │ ├── EmptyException.cs
│ │ │ │ ├── EndsWithException.cs
│ │ │ │ ├── EqualException.cs
│ │ │ │ ├── FalseException.cs
│ │ │ │ ├── InRangeException.cs
│ │ │ │ ├── IsAssignableFromException.cs
│ │ │ │ ├── IsNotTypeException.cs
│ │ │ │ ├── IsTypeException.cs
│ │ │ │ ├── MatchesException.cs
│ │ │ │ ├── NoneException.cs
│ │ │ │ ├── NotEmptyException.cs
│ │ │ │ ├── NotEqualException.cs
│ │ │ │ ├── NotInRangeException.cs
│ │ │ │ ├── NotNullException.cs
│ │ │ │ ├── NotSameException.cs
│ │ │ │ ├── NullException.cs
│ │ │ │ ├── ParameterCountMismatchException.cs
│ │ │ │ ├── ProperSubsetException.cs
│ │ │ │ ├── ProperSupersetException.cs
│ │ │ │ ├── PropertyChangedException.cs
│ │ │ │ ├── SameException.cs
│ │ │ │ ├── SingleException.cs
│ │ │ │ ├── StartsWithException.cs
│ │ │ │ ├── SubsetException.cs
│ │ │ │ ├── SupersetException.cs
│ │ │ │ ├── ThrowsException.cs
│ │ │ │ ├── TimeoutException.cs
│ │ │ │ ├── TrueException.cs
│ │ │ │ └── XunitException.cs
│ │ ├── SetAsserts.cs
│ │ ├── StringAsserts.cs
│ │ └── TypeAsserts.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── xunit.assert.csproj
│ └── xunit.assert.nuspec
├── xunit.console
│ ├── App.config
│ ├── CommandLine.cs
│ ├── Config
│ │ ├── TransformConfigurationElement.cs
│ │ ├── TransformConfigurationElementCollection.cs
│ │ └── XunitConsoleConfigurationSection.cs
│ ├── HTML.xslt
│ ├── ParallelismOption.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── RunnerCallbacks
│ │ ├── RunnerCallback.cs
│ │ ├── StandardRunnerCallback.cs
│ │ └── TeamCityRunnerCallback.cs
│ ├── Utility
│ │ ├── StackFrameTransformer.cs
│ │ ├── Transform.cs
│ │ └── TransformFactory.cs
│ ├── Visitors
│ │ ├── StandardOutputVisitor.cs
│ │ └── TeamCityVisitor.cs
│ ├── xUnit1.xslt
│ └── xunit.console.csproj
├── xunit.core.nuspec
├── xunit.core
│ ├── CollectionAttribute.cs
│ ├── CollectionBehavior.cs
│ ├── CollectionBehaviorAttribute.cs
│ ├── CollectionDefinitionAttribute.cs
│ ├── FactAttribute.cs
│ ├── IClassFixture.cs
│ ├── ICollectionFixture.cs
│ ├── InlineDataAttribute.cs
│ ├── MemberDataAttribute.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Sdk
│ │ ├── ArgumentFormatter.cs
│ │ ├── BeforeAfterTestAttribute.cs
│ │ ├── DataAttribute.cs
│ │ ├── DataDiscoverer.cs
│ │ ├── DataDiscovererAttribute.cs
│ │ ├── ExceptionAggregator.cs
│ │ ├── IDataDiscoverer.cs
│ │ ├── IMessageAggregator.cs
│ │ ├── IMessageBus.cs
│ │ ├── ITestCaseOrderer.cs
│ │ ├── ITraitAttribute.cs
│ │ ├── ITraitDiscoverer.cs
│ │ ├── IXunitTestCase.cs
│ │ ├── IXunitTestCaseDiscoverer.cs
│ │ ├── IXunitTestCollectionFactory.cs
│ │ ├── InlineDataDiscoverer.cs
│ │ ├── RunSummary.cs
│ │ ├── TraitDiscoverer.cs
│ │ ├── TraitDiscovererAttribute.cs
│ │ └── XunitTestCaseDiscovererAttribute.cs
│ ├── TestCaseOrdererAttribute.cs
│ ├── TestFrameworkAttribute.cs
│ ├── TheoryAttribute.cs
│ ├── TheoryData.cs
│ ├── TraitAttribute.cs
│ ├── build
│ │ └── xunit.core.props
│ ├── xunit.core.csproj
│ └── xunit.core.dll.tdnet
├── xunit.empty.ruleset
├── xunit.execution
│ ├── Extensions
│ │ └── ReflectionAbstractionExtensions.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Sdk
│ │ ├── AsyncTestSyncContext.cs
│ │ ├── DefaultTestCaseOrderer.cs
│ │ ├── DisposalTracker.cs
│ │ ├── EnvironmentalWarning.cs
│ │ ├── ExceptionUtility.cs
│ │ ├── ExtensibilityPointFactory.cs
│ │ ├── Frameworks
│ │ │ ├── CollectionPerAssemblyTestCollectionFactory.cs
│ │ │ ├── CollectionPerClassTestCollectionFactory.cs
│ │ │ ├── FactDiscoverer.cs
│ │ │ ├── LambdaTestCase.cs
│ │ │ ├── Runners
│ │ │ │ ├── TestAssemblyRunner.cs
│ │ │ │ ├── TestClassRunner.cs
│ │ │ │ ├── TestCollectionRunner.cs
│ │ │ │ ├── TestMethodRunner.cs
│ │ │ │ ├── XunitTestAssemblyRunner.cs
│ │ │ │ ├── XunitTestClassRunner.cs
│ │ │ │ ├── XunitTestCollectionRunner.cs
│ │ │ │ └── XunitTestMethodRunner.cs
│ │ │ ├── TestCollectionComparer.cs
│ │ │ ├── TestCollectionFactoryHelper.cs
│ │ │ ├── TestFramework.cs
│ │ │ ├── TestFrameworkDiscoverer.cs
│ │ │ ├── TestFrameworkExecutor.cs
│ │ │ ├── TestFrameworkProxy.cs
│ │ │ ├── TheoryDiscoverer.cs
│ │ │ ├── XunitTestCase.cs
│ │ │ ├── XunitTestCollection.cs
│ │ │ ├── XunitTestFramework.cs
│ │ │ ├── XunitTestFrameworkDiscoverer.cs
│ │ │ ├── XunitTestFrameworkExecutor.cs
│ │ │ └── XunitTheoryTestCase.cs
│ │ ├── LongLivedMarshalByRefObject.cs
│ │ ├── MaxConcurrencyTaskScheduler.cs
│ │ ├── MessageAggregator.cs
│ │ ├── MessageBus.cs
│ │ ├── Messages
│ │ │ ├── AfterTestFinished.cs
│ │ │ ├── AfterTestStarting.cs
│ │ │ ├── BaseMessages
│ │ │ │ ├── TestCaseMessage.cs
│ │ │ │ ├── TestClassMessage.cs
│ │ │ │ ├── TestCollectionMessage.cs
│ │ │ │ ├── TestMessage.cs
│ │ │ │ └── TestResultMessage.cs
│ │ │ ├── BeforeTestFinished.cs
│ │ │ ├── BeforeTestStarting.cs
│ │ │ ├── DelegatingMessageBus.cs
│ │ │ ├── DelegatingMessageSink.cs
│ │ │ ├── DiscoveryCompleteMessage.cs
│ │ │ ├── ErrorMessage.cs
│ │ │ ├── TestAssemblyFinished.cs
│ │ │ ├── TestAssemblyStarting.cs
│ │ │ ├── TestCaseDiscoveryMessage.cs
│ │ │ ├── TestCaseFinished.cs
│ │ │ ├── TestCaseStarting.cs
│ │ │ ├── TestClassConstructionFinished.cs
│ │ │ ├── TestClassConstructionStarting.cs
│ │ │ ├── TestClassDisposeFinished.cs
│ │ │ ├── TestClassDisposeStarting.cs
│ │ │ ├── TestClassFinished.cs
│ │ │ ├── TestClassStarting.cs
│ │ │ ├── TestCollectionFinished.cs
│ │ │ ├── TestCollectionStarting.cs
│ │ │ ├── TestFailed.cs
│ │ │ ├── TestFinished.cs
│ │ │ ├── TestMethodFinished.cs
│ │ │ ├── TestMethodStarting.cs
│ │ │ ├── TestPassed.cs
│ │ │ ├── TestSkipped.cs
│ │ │ └── TestStarting.cs
│ │ ├── Reflection
│ │ │ ├── ReflectionAssemblyInfo.cs
│ │ │ ├── ReflectionAttributeInfo.cs
│ │ │ ├── ReflectionMethodInfo.cs
│ │ │ ├── ReflectionParameterInfo.cs
│ │ │ ├── ReflectionTypeInfo.cs
│ │ │ └── Reflector.cs
│ │ ├── SerializationHelper.cs
│ │ ├── SynchronousMessageBus.cs
│ │ ├── TestClassException.cs
│ │ └── TestMessageVisitor.cs
│ ├── xunit.execution.csproj
│ └── xunit.execution.nuspec
├── xunit.nuspec
├── xunit.ruleset
├── xunit.runner.msbuild
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Utility
│ │ └── TraitParser.cs
│ ├── Visitors
│ │ ├── MSBuildVisitor.cs
│ │ ├── StandardOutputVisitor.cs
│ │ └── TeamCityVisitor.cs
│ ├── xunit.cs
│ └── xunit.runner.msbuild.csproj
├── xunit.runner.tdnet
│ ├── Extensions
│ │ └── XunitExtension.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TdNetLogger.cs
│ ├── TdNetRunner.cs
│ ├── TdNetRunnerHelper.cs
│ ├── Visitors
│ │ └── ResultVisitor.cs
│ └── xunit.runner.tdnet.csproj
├── xunit.runner.utility
│ ├── Frameworks
│ │ ├── IFrontController.cs
│ │ ├── NullSourceInformationProvider.cs
│ │ ├── RemoteAppDomainManager.cs
│ │ ├── TestFrameworkOptions.cs
│ │ ├── VisualStudioSourceInformationProvider.cs
│ │ ├── XunitFrontController.cs
│ │ ├── v1
│ │ │ ├── IXunit1Executor.cs
│ │ │ ├── RunSummary.cs
│ │ │ ├── TestClassCallbackHandler.cs
│ │ │ ├── XmlNodeCallbackHandler.cs
│ │ │ ├── XmlNodeExtensions.cs
│ │ │ ├── Xunit1.cs
│ │ │ ├── Xunit1AssemblyInfo.cs
│ │ │ ├── Xunit1ExceptionUtility.cs
│ │ │ ├── Xunit1Executor.cs
│ │ │ ├── Xunit1ReflectionWrapper.cs
│ │ │ ├── Xunit1TestCase.cs
│ │ │ └── Xunit1TestCollection.cs
│ │ └── v2
│ │ │ ├── Xunit2.cs
│ │ │ ├── Xunit2Discoverer.cs
│ │ │ ├── XunitDiscoveryOptions.cs
│ │ │ └── XunitExecutionOptions.cs
│ ├── Project
│ │ ├── XunitFilters.cs
│ │ ├── XunitProject.cs
│ │ └── XunitProjectAssembly.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Utility
│ │ ├── AssemblyHelper.cs
│ │ ├── DiaNavigationData.cs
│ │ ├── DiaSession.cs
│ │ ├── DiaSessionWrapper.cs
│ │ ├── DiaSessionWrapperHelper.cs
│ │ ├── ExceptionUtility.cs
│ │ ├── ExecutionSummary.cs
│ │ ├── LongLivedMarshalByRefObject.cs
│ │ └── RemotingUtility.cs
│ ├── Visitors
│ │ └── TestMessageVisitor.cs
│ ├── xunit.runner.utility.csproj
│ └── xunit.runner.utility.nuspec
├── xunit.runner.visualstudio.nuspec
├── xunit.runner.visualstudio.settings
│ ├── Guids.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SettingsProvider.cs
│ ├── XunitVisualStudioPackage.cs
│ ├── XunitVisualStudioSettings.cs
│ ├── [Content_Types].xml
│ ├── extension.vsixmanifest
│ ├── packages.config
│ ├── xunit.runner.visualstudio.pkgdef
│ └── xunit.runner.visualstudio.settings.csproj
├── xunit.runner.visualstudio.testadapter
│ ├── Constants.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Settings
│ │ ├── XunitTestRunSettings.cs
│ │ ├── XunitTestRunSettingsProvider.cs
│ │ └── XunitVisualStudioSettings.cs
│ ├── Visitors
│ │ ├── VsDiscoveryVisitor.cs
│ │ └── VsExecutionVisitor.cs
│ ├── VsTestRunner.cs
│ ├── packages.config
│ └── xunit.runner.visualstudio.testadapter.csproj
└── xunit.runners.nuspec
├── test
├── GlobalTestAssemblyInfo.cs
├── test.utility
│ ├── Abstractions
│ │ ├── AssemblyWrapper.cs
│ │ ├── AttributeWrapper.cs
│ │ ├── MethodWrapper.cs
│ │ ├── TestCase.cs
│ │ ├── TestCollection.cs
│ │ ├── TestFailed.cs
│ │ ├── TestPassed.cs
│ │ ├── TestSkipped.cs
│ │ └── TypeWrapper.cs
│ ├── AcceptanceTest.cs
│ ├── AcceptanceTestAssembly.cs
│ ├── CulturedFactAttribute.cs
│ ├── CulturedFactAttributeDiscoverer.cs
│ ├── CulturedXunitTestCase.cs
│ ├── Mocks.cs
│ ├── NSubstituteExtensions.cs
│ ├── PreserveWorkingDirectoryAttribute.cs
│ ├── SerializationUtility.cs
│ ├── SpyBeforeAfterTest.cs
│ ├── SpyMessageBus.cs
│ ├── SpyMessageSink.cs
│ ├── TempFile.cs
│ ├── packages.config
│ └── test.utility.csproj
├── test.xunit.assert
│ ├── Asserts
│ │ ├── BooleanAssertsTests.cs
│ │ ├── CollectionAssertsTests.cs
│ │ ├── EqualityAssertsTests.cs
│ │ ├── ExceptionAssertsTests.cs
│ │ ├── IdentityAssertsTests.cs
│ │ ├── NullAssertsTests.cs
│ │ ├── PropertyAssertsTests.cs
│ │ ├── RangeAssertsTests.cs
│ │ ├── RecordTests.cs
│ │ ├── Sdk
│ │ │ └── Exceptions
│ │ │ │ ├── AssertActualExpectedExceptionTests.cs
│ │ │ │ ├── EndsWithExceptionTests.cs
│ │ │ │ ├── EqualExceptionTests.cs
│ │ │ │ ├── StartsWithExceptionTests.cs
│ │ │ │ └── XunitExceptionTests.cs
│ │ ├── SetAssertsTests.cs
│ │ ├── StringAssertsTests.cs
│ │ └── TypeAssertsTests.cs
│ ├── packages.config
│ └── test.xunit.assert.csproj
├── test.xunit.console
│ ├── CommandLineTests.cs
│ ├── Utility
│ │ ├── StackFrameTransformerTests.cs
│ │ └── TransformFactoryFacts.cs
│ ├── packages.config
│ └── test.xunit.console.csproj
├── test.xunit.execution
│ ├── Acceptance
│ │ ├── AsyncAcceptanceTests.cs
│ │ ├── CollectionAcceptanceTests.cs
│ │ ├── FixtureAcceptanceTests.cs
│ │ ├── Xunit2AcceptanceTests.cs
│ │ └── Xunit2TheoryAcceptanceTests.cs
│ ├── Common
│ │ └── XmlTestExecutionVisitorTests.cs
│ ├── Sdk
│ │ ├── ArgumentFormatterTests.cs
│ │ ├── DefaultTestCaseOrdererTests.cs
│ │ ├── Frameworks
│ │ │ ├── CollectionPerAssemblyTestCollectionFactoryTests.cs
│ │ │ ├── CollectionPerClassTestCollectionFactoryTests.cs
│ │ │ ├── TheoryDiscovererTests.cs
│ │ │ ├── XunitTestCaseTests.cs
│ │ │ ├── XunitTestFrameworkDiscovererTests.cs
│ │ │ └── XunitTheoryTestCaseTests.cs
│ │ ├── MessageBusTests.cs
│ │ ├── Reflection
│ │ │ └── ReflectorTests.cs
│ │ ├── SpyMessageSink.cs
│ │ ├── SynchronousMessageBusTests.cs
│ │ └── TestCaseSerializerTests.cs
│ ├── SerializationTests.cs
│ ├── packages.config
│ └── test.xunit.execution.csproj
├── test.xunit.runner.msbuild
│ ├── Utility
│ │ ├── SpyLogger.cs
│ │ └── TraitParserTests.cs
│ ├── Visitors
│ │ ├── StandardOutputVisitorTests.cs
│ │ └── TeamCityVisitorTests.cs
│ ├── packages.config
│ ├── test.xunit.runner.msbuild.csproj
│ └── xunitTests.cs
├── test.xunit.runner.tdnet
│ ├── Extensions
│ │ └── TestResultMessageExtensionsTests.cs
│ ├── TdNetRunnerTests.cs
│ ├── Visitors
│ │ └── ResultVisitorTests.cs
│ ├── packages.config
│ └── test.xunit.runner.tdnet.csproj
├── test.xunit.runner.utility
│ ├── Frameworks
│ │ ├── v1
│ │ │ ├── TestClassCallbackHandlerTests.cs
│ │ │ ├── Xunit1TestCaseTests.cs
│ │ │ └── Xunit1Tests.cs
│ │ └── v2
│ │ │ └── Xunit2Tests.cs
│ ├── Project
│ │ └── XunitFiltersTests.cs
│ ├── SpyTestMessageVisitor.cs
│ ├── Utility
│ │ └── ExceptionUtilityTests.cs
│ ├── Visitors
│ │ ├── TestDiscoveryVisitorTests.cs
│ │ └── TestMessageVisitorTests.cs
│ ├── packages.config
│ └── test.xunit.runner.utility.csproj
├── test.xunit.runner.visualstudio.testadapter
│ ├── packages.config
│ └── test.xunit.runner.visualstudio.testadapter.csproj
└── test.xunit1
│ ├── packages.config
│ ├── test.xunit1.csproj
│ ├── utility
│ ├── AcceptanceTest.cs
│ ├── AcceptanceTestInNewAppDomain.cs
│ ├── MockAssembly.cs
│ ├── ResultXmlUtility.cs
│ ├── SerializationUtility.cs
│ ├── StubExecutorWrapper.cs
│ ├── StubTestRunner.cs
│ ├── StubTransformer.cs
│ └── TestTimingAttribute.cs
│ ├── xunit.extensions
│ ├── AssumeIdentity
│ │ ├── AssumeIdentityAttributeAcceptanceTests.cs
│ │ └── AssumeIdentityAttributeFacts.cs
│ ├── DataTheories
│ │ ├── AcceptanceTests
│ │ │ ├── AcceptanceTestData.xls
│ │ │ ├── ClassDataAcceptanceTests.cs
│ │ │ ├── ExcelDataAcceptanceTests.cs
│ │ │ ├── InlineDataAcceptanceTests.cs
│ │ │ ├── PropertyDataAcceptanceTests.cs
│ │ │ └── TheoryAcceptanceTests.cs
│ │ ├── DataAdapterDataAttributeTests.cs
│ │ ├── GenericTheoryTests.cs
│ │ ├── TheoryAttributeTests.cs
│ │ ├── TheoryCommandTests.cs
│ │ └── UnitTestData.xls
│ └── FreezeClock
│ │ ├── ClockFacts.cs
│ │ ├── FreezeClockAttributeAcceptanceTests.cs
│ │ └── FreezeClockAttributeFacts.cs
│ └── xunit
│ ├── AcceptanceTests
│ ├── AbstractTestClassTests.cs
│ ├── ApartmentAcceptanceTests.cs
│ ├── AsyncAcceptanceTests.cs
│ ├── ConfigFileAcceptanceTests.cs
│ ├── ExecutorAssemblyNodeCallbackAcceptanceTests.cs
│ ├── ExecutorCurrentDirectoryAcceptanceTests.cs
│ ├── FactMethodWithArgumentsTests.cs
│ ├── FailureTimingAcceptanceTests.cs
│ ├── FixtureDataAcceptanceTests.cs
│ ├── SkipAcceptanceTests.cs
│ └── TestTimeoutTests.cs
│ ├── ContainsTests.cs
│ ├── DoesNotContainTests.cs
│ ├── DoesNotThrowTests.cs
│ ├── EmptyTests.cs
│ ├── EqualTests.cs
│ ├── FactAttributeTests.cs
│ ├── FalseTests.cs
│ ├── InRangeTests.cs
│ ├── IsAssignableFromTests.cs
│ ├── IsNotTypeTests.cs
│ ├── IsTypeTests.cs
│ ├── NotEmptyTests.cs
│ ├── NotEqualTests.cs
│ ├── NotInRangeTests.cs
│ ├── NotNullTests.cs
│ ├── NotSameTests.cs
│ ├── NullTests.cs
│ ├── PropertyChangedTests.cs
│ ├── RecordTests.cs
│ ├── SameTests.cs
│ ├── Sdk
│ ├── AfterTestExceptionTests.cs
│ ├── Commands
│ │ ├── ClassCommands
│ │ │ ├── TestClassCommandFactoryTests.cs
│ │ │ ├── TestClassCommandRunnerTests.cs
│ │ │ └── TestClassCommandTests.cs
│ │ └── TestCommands
│ │ │ ├── BeforeAfterCommandTests.cs
│ │ │ ├── ExceptionAndOutputCaptureCommandTests.cs
│ │ │ ├── FactCommandTests.cs
│ │ │ ├── LifetimeCommandTests.cs
│ │ │ ├── SkipCommandTests.cs
│ │ │ ├── TestCommandFactoryTests.cs
│ │ │ ├── TestCommandTests.cs
│ │ │ ├── TimedCommandTests.cs
│ │ │ └── TimeoutCommandTests.cs
│ ├── Exceptions
│ │ ├── AssertActualExpectedExceptionTests.cs
│ │ ├── AssertExceptionTests.cs
│ │ ├── DoesNotThrowExceptionTests.cs
│ │ ├── ExceptionRequirementTests.cs
│ │ ├── InRangeExceptionTests.cs
│ │ ├── NotInRangeExceptionTests.cs
│ │ ├── ThrowsExceptionTests.cs
│ │ └── TraceAssertExceptionTests.cs
│ ├── ExecutorCallbackTests.cs
│ ├── Results
│ │ ├── AssemblyResultTests.cs
│ │ ├── ClassResultTests.cs
│ │ ├── CompositeResultsTests.cs
│ │ ├── FailedResultTests.cs
│ │ ├── MethodResultTests.cs
│ │ ├── PassedResultTests.cs
│ │ └── SkipResultTests.cs
│ └── Utilities
│ │ ├── MethodUtilityTests.cs
│ │ ├── MultiValueDictionaryTests.cs
│ │ ├── ReflectorTests.cs
│ │ └── TypeUtilityTests.cs
│ ├── SerializationTests.cs
│ ├── SingleTests.cs
│ ├── Stubs
│ ├── FixtureSpy.cs
│ ├── StubTestClassCommand.cs
│ └── StubTestCommand.cs
│ ├── ThrowsTests.cs
│ └── TrueTests.cs
├── tools
├── TestDriven.Framework.dll
├── xUnitSummary.xsl
├── xunit.targets
├── xunit.tests.msbuild
└── xunit.vsix.msbuild
├── xunit.msbuild
└── xunit.sln
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.ico binary
2 | *.snk binary
3 | *.xls binary
4 |
5 | *.bat text
6 | *.config text
7 | *.cs text diff=csharp
8 | *.csproj text merge=union
9 | *.manifest text
10 | *.msbuild text
11 | *.nuspec text
12 | *.resx text merge=union
13 | *.ruleset text
14 | *.settings text
15 | *.shfb text
16 | *.targets text
17 | *.tdnet text
18 | *.txt text
19 | *.vb text
20 | *.vbproj text merge=union
21 | *.vsixmanifest text
22 | *.vstemplate text
23 | *.xml text
24 | *.xsl text
25 | *.xslt text
26 | *.xunit text
27 |
28 | *.sln text eol=crlf merge=union
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | [Bb]in
2 | [Oo]bj
3 | packages
4 | help
5 |
6 | *.suo
7 | *.user
8 | *.[Cc]ache
9 | *[Rr]esharper*
10 | *.zip
11 | *.suo
12 | *.user
13 | *.cache
14 | *.nupkg
15 | *.exe
16 | *.dll
17 | *.ncrunch*
18 |
19 | Test*.html
20 | Test*.xml
21 |
22 | Index.dat
23 | Storage.dat
24 |
--------------------------------------------------------------------------------
/build.ps1:
--------------------------------------------------------------------------------
1 | param(
2 | [string]$target = "Test",
3 | [string]$verbosity = "minimal",
4 | [int]$maxCpuCount = 0
5 | )
6 |
7 | # Kill all MSBUILD.EXE processes because they could very likely have a lock against our
8 | # MSBuild runner from when we last ran unit tests.
9 | get-process -name "msbuild" -ea SilentlyContinue | %{ stop-process $_.ID -force }
10 |
11 | $msbuilds = @(get-command msbuild -ea SilentlyContinue)
12 | if ($msbuilds.Count -eq 0) {
13 | $msbuild = join-path $env:windir "Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
14 | } else {
15 | $msbuild = $msbuilds[0].Definition
16 | }
17 |
18 | if ($maxCpuCount -lt 1) {
19 | $maxCpuCountText = $Env:MSBuildProcessorCount
20 | } else {
21 | $maxCpuCountText = ":$maxCpuCount"
22 | }
23 |
24 | $allArgs = @("xunit.msbuild", "/m$maxCpuCountText", "/nologo", "/verbosity:$verbosity", "/t:$target", "/property:RequestedVerbosity=$verbosity", $args)
25 | & $msbuild $allArgs
26 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | Copyright 2014 Outercurve Foundation
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/samples/AssertExamples/AsyncExamples.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Xunit;
4 |
5 | public class AsyncExamples
6 | {
7 | [Fact]
8 | public async void CodeThrowsAsync()
9 | {
10 | Func testCode = () => Task.Factory.StartNew(ThrowingMethod);
11 |
12 | var ex = await Assert.ThrowsAsync(testCode);
13 |
14 | Assert.IsType(ex);
15 | }
16 |
17 | [Fact]
18 | public async void RecordAsync()
19 | {
20 | Func testCode = () => Task.Factory.StartNew(ThrowingMethod);
21 |
22 | var ex = await Record.ExceptionAsync(testCode);
23 |
24 | Assert.IsType(ex);
25 | }
26 |
27 | [Fact]
28 | public async void CodeDoesNotThrow()
29 | {
30 | Func testCode = () => Task.Factory.StartNew(() => { });
31 |
32 | await Assert.DoesNotThrowAsync(testCode);
33 | }
34 |
35 | void ThrowingMethod()
36 | {
37 | throw new NotImplementedException();
38 | }
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/samples/AssertExamples/EqualExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xunit;
4 |
5 | public class EqualExample
6 | {
7 | [Fact]
8 | public void EqualStringIgnoreCase()
9 | {
10 | string expected = "TestString";
11 | string actual = "teststring";
12 |
13 | Assert.False(actual == expected);
14 | Assert.NotEqual(expected, actual);
15 | Assert.Equal(expected, actual, StringComparer.CurrentCultureIgnoreCase);
16 | }
17 |
18 | class DateComparer : IEqualityComparer
19 | {
20 | public bool Equals(DateTime x, DateTime y)
21 | {
22 | return x.Date == y.Date;
23 | }
24 |
25 | public int GetHashCode(DateTime obj)
26 | {
27 | return obj.GetHashCode();
28 | }
29 | }
30 |
31 | [Fact]
32 | public void DateShouldBeEqualEvenThoughTimesAreDifferent()
33 | {
34 | DateTime firstTime = DateTime.Now.Date;
35 | DateTime later = firstTime.AddMinutes(90);
36 |
37 | Assert.NotEqual(firstTime, later);
38 | Assert.Equal(firstTime, later, new DateComparer());
39 | }
40 | }
--------------------------------------------------------------------------------
/samples/AssertExamples/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/AssertExtensions/ExampleFacts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xunit;
3 | using Xunit.Extensions.AssertExtensions;
4 |
5 |
6 | public class ExampleFacts
7 | {
8 | public class BooleanFacts
9 | {
10 | [Fact]
11 | public void ShouldBeTrue()
12 | {
13 | Boolean val = true;
14 |
15 | val.ShouldBeTrue();
16 | }
17 |
18 | [Fact]
19 | public void ShouldBeFalse()
20 | {
21 | Boolean val = false;
22 |
23 | val.ShouldBeFalse();
24 | }
25 |
26 | [Fact]
27 | public void ShouldBeTrueWithMessage()
28 | {
29 | Boolean val = false;
30 |
31 | Exception exception = Record.Exception(() => val.ShouldBeTrue("should be true"));
32 |
33 | Assert.Equal("should be true", exception.Message);
34 | }
35 |
36 | [Fact]
37 | public void ShouldBeFalseWithMessage()
38 | {
39 | Boolean val = true;
40 |
41 | Exception exception = Record.Exception(() => val.ShouldBeFalse("should be false"));
42 |
43 | Assert.Equal("should be false", exception.Message);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/samples/AssertExtensions/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/AssumeIdentity/AssumeIdentityAttributeTests.cs:
--------------------------------------------------------------------------------
1 | using System.Security;
2 | using System.Security.Permissions;
3 | using System.Threading;
4 | using Xunit;
5 |
6 | public class AssumeIdentityAttributeTests
7 | {
8 | [Fact, AssumeIdentity("casper")]
9 | public void AttributeChangesRoleInTestMethod()
10 | {
11 | Assert.True(Thread.CurrentPrincipal.IsInRole("casper"));
12 | }
13 |
14 | [Fact]
15 | public void CallingSecuredMethodWillThrow()
16 | {
17 | Assert.Throws(() => DefeatVillian());
18 | }
19 |
20 | [Fact, AssumeIdentity("Q")]
21 | public void CallingSecuredMethodWithWrongIdentityWillThrow()
22 | {
23 | Assert.Throws(() => DefeatVillian());
24 | }
25 |
26 | [Fact, AssumeIdentity("007")]
27 | public void CallingSecuredMethodWithAssumedIdentityPasses()
28 | {
29 | Assert.DoesNotThrow(() => DefeatVillian());
30 | }
31 |
32 | [PrincipalPermission(SecurityAction.Demand, Role = "007")]
33 | public void DefeatVillian() { }
34 | }
--------------------------------------------------------------------------------
/samples/AssumeIdentity/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/ClassFixtureExample/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/ClassFixtureExample/ClassFixtureTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 | using System.Data.SqlClient;
4 | using Xunit;
5 |
6 | public class ClassFixtureTests : IClassFixture
7 | {
8 | DatabaseFixture database;
9 |
10 | public ClassFixtureTests(DatabaseFixture data)
11 | {
12 | database = data;
13 | }
14 |
15 | [Fact]
16 | public void ConnectionIsEstablished()
17 | {
18 | Assert.NotNull(database.Connection);
19 | }
20 |
21 | [Fact]
22 | public void FooUserWasInserted()
23 | {
24 | string sql = "SELECT COUNT(*) FROM Users WHERE ID = @id;";
25 |
26 | using (SqlCommand cmd = new SqlCommand(sql, database.Connection))
27 | {
28 | cmd.Parameters.AddWithValue("@id", database.FooUserID);
29 |
30 | int rowCount = Convert.ToInt32(cmd.ExecuteScalar());
31 |
32 | Assert.Equal(1, rowCount);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/ClassFixtureExample/DatabaseFixture.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/ClassFixtureExample/DatabaseFixture.mdf
--------------------------------------------------------------------------------
/samples/ClassFixtureExample/DatabaseFixture_log.LDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/ClassFixtureExample/DatabaseFixture_log.LDF
--------------------------------------------------------------------------------
/samples/ClassFixtureExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/ConnectionFacts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xunit;
7 |
8 | [Collection("DatabaseCollection")]
9 | public class ConnectionTests
10 | {
11 | DatabaseFixture database;
12 |
13 | public ConnectionTests(DatabaseFixture data)
14 | {
15 | database = data;
16 | }
17 |
18 | [Fact]
19 | public void ConnectionIsEstablished()
20 | {
21 | Assert.NotNull(database.Connection);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/DatabaseCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xunit;
7 |
8 | [CollectionDefinition("DatabaseCollection")]
9 | public class DatabaseCollection : ICollectionFixture
10 | {
11 | }
12 |
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/DatabaseFixture.mdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/CollectionFixtureExample/DatabaseFixture.mdf
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/DatabaseFixture_log.ldf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/CollectionFixtureExample/DatabaseFixture_log.ldf
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/InsertTests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data.SqlClient;
3 | using Xunit;
4 |
5 | [Collection("DatabaseCollection")]
6 | public class InsertTests
7 | {
8 | DatabaseFixture database;
9 |
10 | public InsertTests(DatabaseFixture fixture)
11 | {
12 | database = fixture;
13 | }
14 |
15 | [Fact]
16 | public void FooUserWasInserted()
17 | {
18 | string sql = "SELECT COUNT(*) FROM Users WHERE ID = @id;";
19 |
20 | using (SqlCommand cmd = new SqlCommand(sql, database.Connection))
21 | {
22 | cmd.Parameters.AddWithValue("@id", database.FooUserID);
23 |
24 | int rowCount = Convert.ToInt32(cmd.ExecuteScalar());
25 |
26 | Assert.Equal(1, rowCount);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/CollectionFixtureExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/ExcelDataExample/AcceptanceTestData.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/ExcelDataExample/AcceptanceTestData.xls
--------------------------------------------------------------------------------
/samples/ExcelDataExample/ExcelDataExamples.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using Xunit;
4 |
5 | public class ExcelDataExamples
6 | {
7 | [Theory]
8 | [ExcelData("UnitTestData.xls", "select * from [Sheet1$A1:C5]")]
9 | public void ExcelXlsTests(int x, string y, string z)
10 | {
11 | Assert.NotEqual("Baz", z);
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/samples/ExcelDataExample/UnitTestData.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/samples/ExcelDataExample/UnitTestData.xls
--------------------------------------------------------------------------------
/samples/ExcelDataExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/GlobalAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyCompany("Outercurve Foundation")]
5 | [assembly: AssemblyProduct("xUnit.net Testing Framework")]
6 | [assembly: AssemblyCopyright("Copyright (C) Outercurve Foundation")]
7 | [assembly: AssemblyVersion("2.0.0.0")]
--------------------------------------------------------------------------------
/samples/SpecificationExamples/SpecificationBaseStyle/ObservationAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SpecificationBaseStyle
4 | {
5 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
6 | public class ObservationAttribute : Attribute { }
7 | }
--------------------------------------------------------------------------------
/samples/SpecificationExamples/SpecificationBaseStyle/SpecificationBase.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace SpecificationBaseStyle
4 | {
5 | [RunWith(typeof(SpecificationBaseRunner))]
6 | public abstract class SpecificationBase
7 | {
8 | protected virtual void Because() { }
9 |
10 | protected virtual void DestroyContext() { }
11 |
12 | protected virtual void EstablishContext() { }
13 |
14 | internal void OnFinish()
15 | {
16 | DestroyContext();
17 | }
18 |
19 | internal void OnStart()
20 | {
21 | EstablishContext();
22 | Because();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/samples/SpecificationExamples/Stack.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | class Stack
5 | {
6 | readonly LinkedList elements = new LinkedList();
7 |
8 | public bool IsEmpty
9 | {
10 | get { return elements.Count == 0; }
11 | }
12 |
13 | public void Push(T element)
14 | {
15 | elements.AddFirst(element);
16 | }
17 |
18 | public T Top
19 | {
20 | get
21 | {
22 | if (elements.Count == 0)
23 | throw new InvalidOperationException("cannot top an empty stack");
24 |
25 | return elements.First.Value;
26 | }
27 | }
28 |
29 | public T Pop()
30 | {
31 | T top = Top;
32 | elements.RemoveFirst();
33 |
34 | return top;
35 | }
36 | }
--------------------------------------------------------------------------------
/samples/SpecificationExamples/SubSpec/SpecificationAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xunit;
4 | using Xunit.Sdk;
5 |
6 | namespace SubSpec
7 | {
8 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
9 | public class SpecificationAttribute : FactAttribute
10 | {
11 | protected override IEnumerable EnumerateTestCommands(IMethodInfo method)
12 | {
13 | try
14 | {
15 | object obj = Activator.CreateInstance(method.MethodInfo.ReflectedType);
16 | method.Invoke(obj, null);
17 | return SpecificationContext.ToTestCommands(method);
18 | }
19 | catch (Exception ex)
20 | {
21 | return new ITestCommand[] { new ExceptionTestCommand(method, ex) };
22 | }
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/samples/SpecificationExamples/SubSpec/SpecificationExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SubSpec
4 | {
5 | public static class SpecificationExtensions
6 | {
7 | public static void Context(this string message, Action arrange)
8 | {
9 | SpecificationContext.Context(message, arrange);
10 | }
11 |
12 | public static void Do(this string message, Action act)
13 | {
14 | SpecificationContext.Do(message, act);
15 | }
16 |
17 | public static void Assert(this string message, Action assert)
18 | {
19 | SpecificationContext.Assert(message, assert);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/SpecificationExamples/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/Stack/Stack.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | public class Stack
6 | {
7 | List elements = new List();
8 |
9 | public int Count
10 | {
11 | get { return elements.Count; }
12 | }
13 |
14 | public bool Contains(T element)
15 | {
16 | return elements.Contains(element);
17 | }
18 |
19 | public T Peek()
20 | {
21 | if (Count == 0)
22 | throw new InvalidOperationException("empty stack");
23 |
24 | return elements.Last();
25 | }
26 |
27 | public T Pop()
28 | {
29 | T element = Peek();
30 | elements.RemoveAt(Count - 1);
31 | return element;
32 | }
33 |
34 | public void Push(T element)
35 | {
36 | elements.Add(element);
37 | }
38 | }
--------------------------------------------------------------------------------
/samples/Stack/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/TestOrderExamples/AlphabeticalOrderer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Xunit.Sdk;
5 |
6 | public class AlphabeticalOrderer : ITestCaseOrderer
7 | {
8 | public IEnumerable OrderTestCases(IEnumerable testCases)
9 | {
10 | var result = testCases.ToList();
11 | result.Sort((x, y) => StringComparer.OrdinalIgnoreCase.Compare(x.Method.Name, y.Method.Name));
12 | return result;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/samples/TestOrderExamples/TestPriorityAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
4 | public class TestPriorityAttribute : Attribute
5 | {
6 | public TestPriorityAttribute(int priority)
7 | {
8 | Priority = priority;
9 | }
10 |
11 | public int Priority { get; private set; }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/TestOrderExamples/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/TracingExample/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xunit;
3 |
4 | public class Example
5 | {
6 | [Fact, TracingSplicer]
7 | public void TestThis()
8 | {
9 | Console.WriteLine("I'm inside the test!");
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/TracingExample/TracingSplicerAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using Xunit;
4 | using Xunit.Sdk;
5 |
6 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
7 | public class TracingSplicerAttribute : BeforeAfterTestAttribute
8 | {
9 | public override void Before(MethodInfo methodUnderTest)
10 | {
11 | Console.WriteLine("Before : {0}.{1}", methodUnderTest.DeclaringType.FullName, methodUnderTest.Name);
12 | }
13 |
14 | public override void After(MethodInfo methodUnderTest)
15 | {
16 | Console.WriteLine("After : {0}.{1}", methodUnderTest.DeclaringType.FullName, methodUnderTest.Name);
17 | }
18 | }
--------------------------------------------------------------------------------
/samples/TracingExample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/TraitExtensibility/CategoryAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xunit.Sdk;
3 |
4 | ///
5 | /// Apply this attribute to your test method to specify a category.
6 | ///
7 | [TraitDiscoverer("CategoryDiscoverer", "TraitExtensibility")]
8 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
9 | class CategoryAttribute : Attribute, ITraitAttribute
10 | {
11 | public CategoryAttribute(string category) { }
12 | }
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/TraitExtensibility/CategoryDiscoverer.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Xunit.Sdk;
3 | using Xunit.Abstractions;
4 | using System.Collections.Generic;
5 |
6 | ///
7 | /// This class discovers all of the tests and test classes that have
8 | /// applied the Category attribute
9 | ///
10 | public class CategoryDiscoverer : ITraitDiscoverer
11 | {
12 | ///
13 | /// Gets the trait values from the Category attribute.
14 | ///
15 | /// The trait attribute containing the trait values.
16 | /// The trait values.
17 | public IEnumerable> GetTraits(IAttributeInfo traitAttribute)
18 | {
19 | var ctorArgs = traitAttribute.GetConstructorArguments().ToList();
20 | yield return new KeyValuePair("Category", ctorArgs[0].ToString());
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/TraitExtensibility/Example.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using Xunit;
3 |
4 | public class Example
5 | {
6 | [Fact, Category("Trait")]
7 | public void ExampleFact()
8 | {
9 | Assert.True(true);
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/TraitExtensibility/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/UseCulture/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/CodeAnalysisDictionary.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | xunit
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/common/Application.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/src/common/Application.ico
--------------------------------------------------------------------------------
/src/common/AssemblyExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Reflection;
4 |
5 | internal static class AssemblyExtensions
6 | {
7 | public static string GetLocalCodeBase(this Assembly assembly)
8 | {
9 | string codeBase = assembly.CodeBase;
10 | if (codeBase == null)
11 | return null;
12 |
13 | if (!codeBase.StartsWith("file:///"))
14 | throw new ArgumentException(String.Format("Code base {0} in wrong format; must start with file:///", codeBase), "assembly");
15 |
16 | codeBase = codeBase.Substring(8);
17 | if (Path.DirectorySeparatorChar == '/')
18 | return "/" + codeBase;
19 |
20 | return codeBase.Replace('/', Path.DirectorySeparatorChar);
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/common/DisposableExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | internal static class DisposableExtensions
4 | {
5 | public static void SafeDispose(this IDisposable disposable)
6 | {
7 | if (disposable != null)
8 | disposable.Dispose();
9 | }
10 | }
--------------------------------------------------------------------------------
/src/common/GlobalAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Reflection;
3 |
4 | [assembly: AssemblyCompany("Outercurve Foundation")]
5 | [assembly: AssemblyProduct("xUnit.net Testing Framework")]
6 | [assembly: AssemblyCopyright("Copyright (C) Outercurve Foundation")]
7 | [assembly: AssemblyVersion("2.0.0.0")]
8 |
9 | [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Xunit.Sdk")]
10 | [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "xunit")]
11 | [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "extensions")]
12 | [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "utility")]
13 | [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "runner")]
--------------------------------------------------------------------------------
/src/common/SerializationInfoExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Serialization;
2 |
3 | internal static class SerializationInfoExtensions
4 | {
5 | public static T GetValue(this SerializationInfo info, string name)
6 | {
7 | return (T)info.GetValue(name, typeof(T));
8 | }
9 | }
--------------------------------------------------------------------------------
/src/common/TestDiscoveryVisitor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Xunit.Abstractions;
3 |
4 | namespace Xunit
5 | {
6 | internal class TestDiscoveryVisitor : TestMessageVisitor
7 | {
8 | public TestDiscoveryVisitor()
9 | {
10 | TestCases = new List();
11 | }
12 |
13 | public List TestCases { get; private set; }
14 |
15 | public override void Dispose()
16 | {
17 | TestCases.ForEach(testCase => testCase.Dispose());
18 | TestCases = null;
19 | }
20 |
21 | protected override bool Visit(ITestCaseDiscoveryMessage discovery)
22 | {
23 | TestCases.Add(discovery.TestCase);
24 |
25 | return true;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/common/TestOptionsNames.cs:
--------------------------------------------------------------------------------
1 | internal static class TestOptionsNames
2 | {
3 | internal static class Discovery
4 | {
5 | }
6 |
7 | internal static class Execution
8 | {
9 | public static readonly string SynchronousMessageReporting = "xunit.SynchronousMessageReporting";
10 | public static readonly string DisableParallelization = "xunit.DisableParallelization";
11 | public static readonly string MaxParallelThreads = "xunit.MaxParallelThreads";
12 | }
13 | }
--------------------------------------------------------------------------------
/src/signing.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xamarin/xunit/ddd38e486e722ac3ded0435068f8e33f1d4f87d1/src/signing.snk
--------------------------------------------------------------------------------
/src/xunit.abstractions/Frameworks/ISourceInformation.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// Represents source information about a test case.
5 | ///
6 | public interface ISourceInformation
7 | {
8 | ///
9 | /// Gets or sets the source file name. A null value indicates that the
10 | /// source file name is not known.
11 | ///
12 | string FileName { get; set; }
13 |
14 | ///
15 | /// Gets or sets the source file line. A null value indicates that the
16 | /// source file line is not known.
17 | ///
18 | int? LineNumber { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/xunit.abstractions/Frameworks/ISourceInformationProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a provider which gives source line information for a test case. Generally
7 | /// consumed by an implementation of during Find operations.
8 | ///
9 | public interface ISourceInformationProvider : IDisposable
10 | {
11 | ///
12 | /// Returns the source information for a test case.
13 | ///
14 | /// The test case to retrieve information for.
15 | /// The source information, with null string and int values when the information is not available.
16 | /// Note: return value should never be null, only the interior data values inside.
17 | ISourceInformation GetSourceInformation(ITestCase testCase);
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifierShouldBeCasedCorrectly", MessageId = "abstractions")]
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/IFinishedMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This is the base message for various types of completion that can occur during the
5 | /// various phases of execution process (e.g., test case, test class, test collection,
6 | /// and assembly).
7 | ///
8 | public interface IFinishedMessage : IMessageSinkMessage
9 | {
10 | ///
11 | /// The execution time (in seconds) for this execution.
12 | ///
13 | decimal ExecutionTime { get; }
14 |
15 | ///
16 | /// The number of failing tests.
17 | ///
18 | int TestsFailed { get; }
19 |
20 | ///
21 | /// The total number of tests run.
22 | ///
23 | int TestsRun { get; }
24 |
25 | ///
26 | /// The number of skipped tests.
27 | ///
28 | int TestsSkipped { get; }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/IMessageSink.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents an endpoint for the reception of test messages.
7 | ///
8 | public interface IMessageSink : IDisposable
9 | {
10 | ///
11 | /// Reports the presence of a message on the message bus. This method should
12 | /// never throw exceptions.
13 | ///
14 | /// The message from the message bus
15 | /// Return true to continue running tests, or false to stop.
16 | bool OnMessage(IMessageSinkMessage message);
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/IMessageSinkMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// This is the base interface for all test messages. A test message is a message that is
7 | /// used to communicate the status of discovery and execution of tests.
8 | ///
9 | public interface IMessageSinkMessage { }
10 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/ITestCaseMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Xunit.Abstractions
5 | {
6 | ///
7 | /// Base message interface for all messages related to test cases.
8 | ///
9 | public interface ITestCaseMessage : ITestCollectionMessage
10 | {
11 | ///
12 | /// The test case that is associated with this message.
13 | ///
14 | ITestCase TestCase { get; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/ITestClassMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// Base message interface for all messages related to test classes.
5 | ///
6 | public interface ITestClassMessage : ITestCollectionMessage
7 | {
8 | ///
9 | /// The fully-qualified name of the test class.
10 | ///
11 | string ClassName { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/ITestCollectionMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Xunit.Abstractions
5 | {
6 | ///
7 | /// Base message interface for all messages related to test collections.
8 | ///
9 | public interface ITestCollectionMessage : IMessageSinkMessage
10 | {
11 | ///
12 | /// Gets the test collection this test message is associated with.
13 | ///
14 | ITestCollection TestCollection { get; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/ITestMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Xunit.Abstractions
5 | {
6 | ///
7 | /// Base message interface for all messages related to tests.
8 | ///
9 | public interface ITestMessage : ITestCaseMessage
10 | {
11 | ///
12 | /// The display name of the test.
13 | ///
14 | string TestDisplayName { get; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/BaseInterfaces/ITestResultMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This is the base interface for all individual test results (e.g., tests which
5 | /// pass, fail, or are skipped).
6 | ///
7 | public interface ITestResultMessage : ITestMessage
8 | {
9 | ///
10 | /// The execution time of the test, in seconds.
11 | ///
12 | decimal ExecutionTime { get; }
13 |
14 | ///
15 | /// The captured output of the test.
16 | ///
17 | string Output { get; }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IAfterTestFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message is sent during execution to indicate that the After method of
5 | /// a has completed executing.
6 | ///
7 | public interface IAfterTestFinished : ITestMessage
8 | {
9 | ///
10 | /// The fully qualified type name of the .
11 | ///
12 | string AttributeName { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IAfterTestStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message is sent during execution to indicate that the After method of
5 | /// a is about to execute.
6 | ///
7 | public interface IAfterTestStarting : ITestMessage
8 | {
9 | ///
10 | /// The fully qualified type name of the .
11 | ///
12 | string AttributeName { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IBeforeTestFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message is sent during execution to indicate that the Before method of
5 | /// a has completed executing.
6 | ///
7 | public interface IBeforeTestFinished : ITestMessage
8 | {
9 | ///
10 | /// The fully qualified type name of the .
11 | ///
12 | string AttributeName { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IBeforeTestStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message is sent during execution to indicate that the Before method of
5 | /// a is about to execute.
6 | ///
7 | public interface IBeforeTestStarting : ITestMessage
8 | {
9 | ///
10 | /// The fully qualified type name of the .
11 | ///
12 | string AttributeName { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IDiscoveryCompleteMessage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// This message indicates that the discovery process has been completed for
7 | /// the requested assembly.
8 | ///
9 | public interface IDiscoveryCompleteMessage : IMessageSinkMessage
10 | {
11 | ///
12 | /// Gets the list of warnings that were raised during discovery.
13 | ///
14 | IEnumerable Warnings { get; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/IErrorMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that an error has occurred in the execution process.
5 | ///
6 | public interface IErrorMessage : IMessageSinkMessage, IFailureInformation
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestAssemblyFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that the execution process has been completed for
5 | /// the requested assembly.
6 | ///
7 | public interface ITestAssemblyFinished : IFinishedMessage
8 | {
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestCaseDiscoveryMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test case had been found during the discovery process.
5 | ///
6 | public interface ITestCaseDiscoveryMessage : ITestCaseMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestCaseFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test case has finished executing.
5 | ///
6 | public interface ITestCaseFinished : ITestCaseMessage, IFinishedMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestCaseStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test case is about to start executing.
5 | ///
6 | public interface ITestCaseStarting : ITestCaseMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassConstructionFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that an instance of a test class has just been constructed.
5 | /// Instance (non-static) methods of tests get a new instance of the test class for each
6 | /// individual test execution; static methods do not get an instance of the test class.
7 | ///
8 | public interface ITestClassConstructionFinished : ITestMessage
9 | {
10 | }
11 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassConstructionStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that an instance of a test class is about to be constructed.
5 | /// Instance (non-static) methods of tests get a new instance of the test class for each
6 | /// individual test execution; static methods do not get an instance of the test class.
7 | ///
8 | public interface ITestClassConstructionStarting : ITestMessage
9 | {
10 | }
11 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassDisposeFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that the method was
5 | /// just called on the test class for the test case that just finished executing.
6 | ///
7 | public interface ITestClassDisposeFinished : ITestMessage
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassDisposeStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that the method is
5 | /// about to be called on the test class for the test case that just finished executing.
6 | ///
7 | public interface ITestClassDisposeStarting : ITestMessage
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test class has finished executing (meaning, all of the
5 | /// test cases in this test class have finished running).
6 | ///
7 | public interface ITestClassFinished : ITestClassMessage, IFinishedMessage
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestClassStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test class is about to begin running.
5 | ///
6 | public interface ITestClassStarting : ITestClassMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestCollectionFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test collection has just finished executing (meaning,
5 | /// all the test classes in the collection has finished).
6 | ///
7 | public interface ITestCollectionFinished : ITestCollectionMessage, IFinishedMessage
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestCollectionStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test collection has is about to start executing.
5 | ///
6 | public interface ITestCollectionStarting : ITestCollectionMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestFailed.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test has failed.
5 | ///
6 | public interface ITestFailed : ITestResultMessage, IFailureInformation
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test has finished executing.
5 | ///
6 | public interface ITestFinished : ITestMessage
7 | {
8 | ///
9 | /// Gets the time spent executing the test, in seconds.
10 | ///
11 | decimal ExecutionTime { get; }
12 |
13 | ///
14 | /// The captured output of the test.
15 | ///
16 | string Output { get; }
17 |
18 | // TODO: How do we differentiate a test (when a test case has multiple tests)?
19 | // Is it solely by the display name of the test?
20 | }
21 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestMethodFinished.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test method has finished executing (meaning, all
5 | /// the test cases that derived from the test method have finished).
6 | ///
7 | public interface ITestMethodFinished : ITestCollectionMessage
8 | {
9 | ///
10 | /// The fully-qualified name of the test class.
11 | ///
12 | string ClassName { get; }
13 |
14 | ///
15 | /// The name of the test method.
16 | ///
17 | string MethodName { get; }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestMethodStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test method is about to begin executing.
5 | ///
6 | public interface ITestMethodStarting : ITestCollectionMessage
7 | {
8 | ///
9 | /// The fully-qualified name of the test class.
10 | ///
11 | string ClassName { get; }
12 |
13 | ///
14 | /// The name of the test method.
15 | ///
16 | string MethodName { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestPassed.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// Indicates that a test has passed.
5 | ///
6 | public interface ITestPassed : ITestResultMessage
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestSkipped.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test was skipped.
5 | ///
6 | public interface ITestSkipped : ITestResultMessage
7 | {
8 | ///
9 | /// The reason given for skipping the test.
10 | ///
11 | string Reason { get; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Messages/ITestStarting.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Abstractions
2 | {
3 | ///
4 | /// This message indicates that a test is about to start executing.
5 | ///
6 | public interface ITestStarting : ITestMessage
7 | {
8 | // TODO: How do we differentiate a test (when a test case has multiple tests)?
9 | // Is it solely by the display name of the test?
10 | }
11 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Reflection;
4 |
5 | // This file does not use GlobalAssemblyInfo.cs because its version should not change over time.
6 | // Once 2.0 ships, this assembly will be considered to be frozen.
7 |
8 | [assembly: AssemblyTitle("xUnit.net Abstractions")]
9 | [assembly: AssemblyCompany("Outercurve Foundation")]
10 | [assembly: AssemblyProduct("xUnit.net Testing Framework")]
11 | [assembly: AssemblyCopyright("Copyright (C) Outercurve Foundation")]
12 | [assembly: CLSCompliant(true)]
13 | [assembly: AssemblyVersion("2.0.0.0")]
14 |
15 | [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "xunit")]
16 |
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IParameterInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents information about a method parameter. The primary implementation is based on runtime
7 | /// reflection, but may also be implemented by runner authors to provide non-reflection-based
8 | /// test discovery (for example, AST-based runners like CodeRush or Resharper).
9 | ///
10 | public interface IParameterInfo
11 | {
12 | ///
13 | /// The name of the parameter.
14 | ///
15 | string Name { get; }
16 |
17 | ///
18 | /// Gets the type of the parameter.
19 | ///
20 | ITypeInfo ParameterType { get; }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IReflectionAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a reflection-backed implementation of .
7 | ///
8 | public interface IReflectionAssemblyInfo : IAssemblyInfo
9 | {
10 | ///
11 | /// Gets the underlying for the assembly.
12 | ///
13 | Assembly Assembly { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IReflectionAttributeInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a reflection-backed implementation of .
7 | ///
8 | public interface IReflectionAttributeInfo : IAttributeInfo
9 | {
10 | ///
11 | /// Gets the instance of the attribute, if available.
12 | ///
13 | Attribute Attribute { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IReflectionMethodInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a reflection-backed implementation of .
7 | ///
8 | public interface IReflectionMethodInfo : IMethodInfo
9 | {
10 | ///
11 | /// Gets the underlying for the method.
12 | ///
13 | MethodInfo MethodInfo { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IReflectionParameterInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a reflection-backed implementation of .
7 | ///
8 | public interface IReflectionParameterInfo : IParameterInfo
9 | {
10 | ///
11 | /// Gets the underlying for the parameter.
12 | ///
13 | ParameterInfo ParameterInfo { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/Reflection/IReflectionTypeInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a reflection-backed implementation of .
7 | ///
8 | public interface IReflectionTypeInfo : ITypeInfo
9 | {
10 | ///
11 | /// Gets the underlying object.
12 | ///
13 | Type Type { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/TestCases/ITestCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit.Abstractions
4 | {
5 | ///
6 | /// Represents a group of test cases. Test collections form the basis of the parallelization in
7 | /// xUnit.net. Test cases which are in the same test collection will not be run in parallel
8 | /// against sibling tests, but will run in parallel against tests in other collections.
9 | ///
10 | public interface ITestCollection
11 | {
12 | ///
13 | /// Gets the type that the test collection was defined with, if available; may be null
14 | /// if the test collection didn't have a definition type.
15 | ///
16 | ITypeInfo CollectionDefinition { get; }
17 |
18 | ///
19 | /// Gets the display name of the test collection.
20 | ///
21 | string DisplayName { get; }
22 |
23 | ///
24 | /// Gets the test collection ID. Test collection equality is determined by comparing IDs.
25 | ///
26 | Guid ID { get; }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/xunit.abstractions/xunit.abstractions.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ef8381db-7aa0-41b8-99c5-7a69f1a61f18
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/xunit.assert.source.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | xunit.assert.source
5 | 2.0.0-beta
6 | xUnit.net [Assertion Library, as source]
7 | James Newkirk, Brad Wilson
8 | Includes the current assertion library from xUnit.net, as source into your project.
9 | en-US
10 | https://github.com/xunit/xunit
11 | https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png
12 | https://raw.githubusercontent.com/xunit/xunit/master/license.txt
13 | false
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Comparers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using Xunit.Sdk;
5 |
6 | namespace Xunit
7 | {
8 | public partial class Assert
9 | {
10 | static IComparer GetComparer() where T : IComparable
11 | {
12 | return new AssertComparer();
13 | }
14 |
15 | static IEqualityComparer GetEqualityComparer(bool skipTypeCheck = false, IEqualityComparer innerComparer = null)
16 | {
17 | return new AssertEqualityComparer(skipTypeCheck, innerComparer);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Guards.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit
4 | {
5 | public partial class Assert
6 | {
7 | ///
8 | internal static void GuardArgumentNotNull(string argName, object argValue)
9 | {
10 | if (argValue == null)
11 | throw new ArgumentNullException(argName);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/NullAsserts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xunit.Sdk;
3 |
4 | namespace Xunit
5 | {
6 | public partial class Assert
7 | {
8 | ///
9 | /// Verifies that an object reference is not null.
10 | ///
11 | /// The object to be validated
12 | /// Thrown when the object is not null
13 | public static void NotNull(object @object)
14 | {
15 | if (@object == null)
16 | throw new NotNullException();
17 | }
18 |
19 | ///
20 | /// Verifies that an object reference is null.
21 | ///
22 | /// The object to be inspected
23 | /// Thrown when the object reference is not null
24 | public static void Null(object @object)
25 | {
26 | if (@object != null)
27 | throw new NullException(@object);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/AssertCollectionCountException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Globalization;
4 |
5 | namespace Xunit.Sdk
6 | {
7 | ///
8 | /// Exception thrown when the collection did not contain exactly the given number element.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class AssertCollectionCountException : XunitException
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | /// The expected number of items in the collection.
17 | /// The actual number of items in the collection.
18 | public AssertCollectionCountException(int expectedCount, int actualCount)
19 | : base(String.Format(CultureInfo.CurrentCulture, "The collection contained {0} matching element(s) instead of {1}.", actualCount, expectedCount)) { }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/DoesNotContainException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Globalization;
4 |
5 | namespace Xunit.Sdk
6 | {
7 | ///
8 | /// Exception thrown when a collection unexpectedly contains the expected value.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class DoesNotContainException : XunitException
12 | {
13 | ///
14 | /// Creates a new instance of the class.
15 | ///
16 | /// The expected object value
17 | public DoesNotContainException(object expected)
18 | : base(String.Format(CultureInfo.CurrentCulture, "Assert.DoesNotContain() Failure: Found: {0}", expected)) { }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/DoesNotMatchException.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Sdk
2 | {
3 | using System;
4 | using System.Diagnostics.CodeAnalysis;
5 | using System.Globalization;
6 |
7 | ///
8 | /// Exception thrown when a string unexpectedly matches a regular expression.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class DoesNotMatchException : XunitException
12 | {
13 | ///
14 | /// Creates a new instance of the class.
15 | ///
16 | /// The regular expression pattern expected not to match
17 | /// The actual value
18 | public DoesNotMatchException(object expectedRegexPattern, object actual)
19 | : base(String.Format(CultureInfo.CurrentCulture, "Assert.DoesNotMatch() Failure:{2}Regex: {0}{2}Value: {1}", expectedRegexPattern, actual, Environment.NewLine)) { }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/EmptyException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a collection is unexpectedly not empty.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class EmptyException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public EmptyException()
16 | : base("Assert.Empty() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/FalseException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a value is unexpectedly true.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class FalseException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The user message to be display, or null for the default message
16 | public FalseException(string userMessage)
17 | : base(userMessage ?? "Assert.False() Failure") { }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/IsAssignableFromException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when the value is unexpectedly not of the given type or a derived type.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class IsAssignableFromException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The expected type
16 | /// The actual object value
17 | public IsAssignableFromException(Type expected, object actual)
18 | : base(expected, actual == null ? null : actual.GetType(), "Assert.IsAssignableFrom() Failure") { }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/IsNotTypeException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when the value is unexpectedly of the exact given type.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class IsNotTypeException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The expected type
16 | /// The actual object value
17 | public IsNotTypeException(Type expected, object actual)
18 | : base(expected, actual == null ? null : actual.GetType(), "Assert.IsNotType() Failure") { }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/IsTypeException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when the value is unexpectedly not of the exact given type.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class IsTypeException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The expected type name
16 | /// The actual type name
17 | public IsTypeException(string expectedTypeName, string actualTypeName)
18 | : base(expectedTypeName, actualTypeName, "Assert.IsType() Failure") { }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/MatchesException.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit.Sdk
2 | {
3 | using System;
4 | using System.Diagnostics.CodeAnalysis;
5 | using System.Globalization;
6 |
7 | ///
8 | /// Exception thrown when a string does not match a regular expression.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class MatchesException : XunitException
12 | {
13 | ///
14 | /// Creates a new instance of the class.
15 | ///
16 | /// The expected regular expression pattern
17 | /// The actual value
18 | public MatchesException(object expectedRegexPattern, object actual)
19 | : base(String.Format(CultureInfo.CurrentCulture, "Assert.Matches() Failure:{2}Regex: {0}{2}Value: {1}", expectedRegexPattern, actual, Environment.NewLine)) { }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NoneException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when the collection did not contain exactly zero elements.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NoneException : AssertCollectionCountException
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The numbers of items in the collection.
16 | public NoneException(int count) : base(0, count) { }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NotEmptyException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a collection is unexpectedly empty.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NotEmptyException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public NotEmptyException()
16 | : base("Assert.NotEmpty() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NotEqualException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when two values are unexpectedly equal.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NotEqualException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public NotEqualException()
16 | : base("Assert.NotEqual() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NotNullException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when an object is unexpectedly null.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NotNullException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public NotNullException()
16 | : base("Assert.NotNull() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NotSameException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when two values are unexpected the same instance.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NotSameException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public NotSameException()
16 | : base("Assert.NotSame() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/NullException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when an object reference is unexpectedly not null.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class NullException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | ///
16 | public NullException(object actual)
17 | : base(null, actual, "Assert.Null() Failure") { }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/ParameterCountMismatchException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception to be thrown from theory execution when the number of
8 | /// parameter values does not the test method signature.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class ParameterCountMismatchException : Exception
12 | {
13 | ///
14 | public ParameterCountMismatchException() { }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/ProperSubsetException.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a set is not a proper subset of another set.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class ProperSubsetException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public ProperSubsetException(IEnumerable expected, IEnumerable actual)
16 | : base(expected, actual, "Assert.ProperSubset() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/ProperSupersetException.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a set is not a proper superset of another set.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class ProperSupersetException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public ProperSupersetException(IEnumerable expected, IEnumerable actual)
16 | : base(expected, actual, "Assert.ProperSuperset() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/PropertyChangedException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Globalization;
4 |
5 | namespace Xunit.Sdk
6 | {
7 | ///
8 | /// Exception thrown when code unexpectedly fails change a property.
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class PropertyChangedException : XunitException
12 | {
13 | ///
14 | /// Creates a new instance of the class. Call this constructor
15 | /// when no exception was thrown.
16 | ///
17 | /// The name of the property that was expected to be changed.
18 | public PropertyChangedException(string propertyName)
19 | : base(String.Format(CultureInfo.CurrentCulture, "Assert.PropertyChanged failure: Property {0} was not set", propertyName)) { }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/SameException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when two object references are unexpectedly not the same instance.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class SameException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The expected object reference
16 | /// The actual object reference
17 | public SameException(object expected,
18 | object actual)
19 | : base(expected, actual, "Assert.Same() Failure") { }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/SingleException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when the collection did not contain exactly one element.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class SingleException : AssertCollectionCountException
11 | {
12 | ///
13 | /// Initializes a new instance of the class.
14 | ///
15 | /// The numbers of items in the collection.
16 | public SingleException(int count) : base(1, count) { }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/SubsetException.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a set is not a subset of another set.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class SubsetException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public SubsetException(IEnumerable expected, IEnumerable actual)
16 | : base(expected, actual, "Assert.Subset() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/SupersetException.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a set is not a superset of another set.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class SupersetException : AssertActualExpectedException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | public SupersetException(IEnumerable expected, IEnumerable actual)
16 | : base(expected, actual, "Assert.Superset() Failure") { }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/TimeoutException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Globalization;
4 |
5 | namespace Xunit.Sdk
6 | {
7 | ///
8 | /// Exception thrown when a test method exceeds the given timeout value
9 | ///
10 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
11 | public class TimeoutException : XunitException
12 | {
13 | ///
14 | /// Creates a new instance of the class.
15 | ///
16 | /// The timeout value, in milliseconds
17 | public TimeoutException(long timeout)
18 | : base(String.Format(CultureInfo.CurrentCulture, "Test execution time exceeded: {0}ms", timeout)) { }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Asserts/Sdk/Exceptions/TrueException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 |
4 | namespace Xunit.Sdk
5 | {
6 | ///
7 | /// Exception thrown when a value is unexpectedly false.
8 | ///
9 | [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")]
10 | public class TrueException : XunitException
11 | {
12 | ///
13 | /// Creates a new instance of the class.
14 | ///
15 | /// The user message to be displayed, or null for the default message
16 | public TrueException(string userMessage)
17 | : base(userMessage ?? "Assert.True() Failure") { }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/xunit.assert/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Security;
4 |
5 | [assembly: AssemblyTitle("xUnit.net Assertion Library")]
6 | [assembly: CLSCompliant(true)]
7 |
--------------------------------------------------------------------------------
/src/xunit.assert/xunit.assert.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | xunit.assert
5 | 2.0.0-beta
6 | xUnit.net [Assertion Library]
7 | James Newkirk, Brad Wilson
8 |
9 | Includes the current assertion library from xUnit.net (xunit.assert.dll).
10 | Supported platforms: Desktop .NET 4.5+, Modern Windows 8+, Windows Phone 8+ (Silverlight), Windows Phone 8.1+ (Universal), Portable Libraries (supporting Profile259).
11 |
12 | en-US
13 | https://github.com/xunit/xunit
14 | https://raw.githubusercontent.com/xunit/media/master/logo-512-transparent.png
15 | https://raw.githubusercontent.com/xunit/xunit/master/license.txt
16 | false
17 |
18 |
--------------------------------------------------------------------------------
/src/xunit.console/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/xunit.console/Config/TransformConfigurationElement.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 |
3 | namespace Xunit.ConsoleClient
4 | {
5 | public class TransformConfigurationElement : ConfigurationElement
6 | {
7 | [ConfigurationProperty("commandline", IsRequired = true, IsKey = true)]
8 | public string CommandLine
9 | {
10 | get { return (string)this["commandline"]; }
11 | set { this["commandline"] = value; }
12 | }
13 |
14 | [ConfigurationProperty("description", IsRequired = true)]
15 | public string Description
16 | {
17 | get { return (string)this["description"]; }
18 | set { this["description"] = value; }
19 | }
20 |
21 | [ConfigurationProperty("xslfile", IsRequired = true)]
22 | public string XslFile
23 | {
24 | get { return (string)this["xslfile"]; }
25 | set { this["xslfile"] = value; }
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/xunit.console/Config/TransformConfigurationElementCollection.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 |
3 | namespace Xunit.ConsoleClient
4 | {
5 | public class TransformConfigurationElementCollection : ConfigurationElementCollection
6 | {
7 | protected override ConfigurationElement CreateNewElement()
8 | {
9 | return new TransformConfigurationElement();
10 | }
11 |
12 | protected override object GetElementKey(ConfigurationElement element)
13 | {
14 | return ((TransformConfigurationElement)element).CommandLine;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/xunit.console/Config/XunitConsoleConfigurationSection.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 |
3 | namespace Xunit.ConsoleClient
4 | {
5 | public class XunitConsoleConfigurationSection : ConfigurationSection
6 | {
7 | [ConfigurationProperty("transforms", IsDefaultCollection = false)]
8 | public TransformConfigurationElementCollection Transforms
9 | {
10 | get { return (TransformConfigurationElementCollection)this["transforms"]; }
11 | set { this["transforms"] = value; }
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/xunit.console/ParallelismOption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Xunit.ConsoleClient
8 | {
9 | public enum ParallelismOption
10 | {
11 | none,
12 | collections,
13 | assemblies,
14 | all
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/xunit.console/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly : AssemblyTitle("xUnit.net Console Test Runner")]
--------------------------------------------------------------------------------
/src/xunit.console/Utility/Transform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml.Linq;
7 |
8 | namespace Xunit.ConsoleClient
9 | {
10 | public class Transform
11 | {
12 | public string CommandLine;
13 | public string Description;
14 | public Action OutputHandler;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/xunit.core/CollectionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Xunit
4 | {
5 | ///
6 | /// Used to declare a specific test collection for a test class.
7 | ///
8 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
9 | public sealed class CollectionAttribute : Attribute
10 | {
11 | ///
12 | /// Initializes a new instance of the class.
13 | ///
14 | /// The test collection name.
15 | public CollectionAttribute(string name) { }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/xunit.core/CollectionBehavior.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit
2 | {
3 | ///
4 | /// Defines the built-in behavior types for collections in xUnit.net.
5 | ///
6 | public enum CollectionBehavior
7 | {
8 | ///
9 | /// By default, generates a collection per assembly, and any test classes that are not
10 | /// decorated with will be placed into the assembly-level
11 | /// collection.
12 | ///
13 | CollectionPerAssembly,
14 |
15 | ///
16 | /// By default, generates a collection per test class for any test classes that are not
17 | /// decorated with .
18 | ///
19 | CollectionPerClass
20 | }
21 | }
--------------------------------------------------------------------------------
/src/xunit.core/CollectionDefinitionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Xunit
5 | {
6 | ///
7 | /// Used to declare a test collection container class. The container class gives
8 | /// developers a place to attach interfaces like and
9 | /// that will be applied to all tests classes
10 | /// that are members of the test collection.
11 | ///
12 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
13 | public sealed class CollectionDefinitionAttribute : Attribute
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// The test collection name.
19 | public CollectionDefinitionAttribute(string name) { }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/xunit.core/IClassFixture.cs:
--------------------------------------------------------------------------------
1 | namespace Xunit
2 | {
3 | ///
4 | /// Used to decorate xUnit.net test classes and collections to indicate a test which has
5 | /// per-test-class fixture data. An instance of the fixture data is initialized just before
6 | /// the first test in the class is run, and if it implements IDisposable, is disposed
7 | /// after the last test in the class is run. To gain access to the fixture data from
8 | /// inside the test, a constructor argument should be added to the test class which
9 | /// exactly matches the .
10 | ///
11 | /// The type of the fixture.
12 | public interface IClassFixture where TFixture : class, new() { }
13 | }
14 |
--------------------------------------------------------------------------------
/src/xunit.core/ICollectionFixture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace Xunit
5 | {
6 | ///
7 | /// Used to decorate xUnit.net test classes and collections to indicate a test which has
8 | /// per-test-collection fixture data. An instance of the fixture data is initialized just before
9 | /// the first test in the collection is run, and if it implements IDisposable, is disposed
10 | /// after the last test in the collection is run. To gain access to the fixture data from
11 | /// inside the test, a constructor argument should be added to the test class which
12 | /// exactly matches the .
13 | ///
14 | /// The type of the fixture.
15 | public interface ICollectionFixture where TFixture : class, new() { }
16 | }
17 |
--------------------------------------------------------------------------------
/src/xunit.core/InlineDataAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Reflection;
4 | using Xunit.Sdk;
5 |
6 | namespace Xunit
7 | {
8 | ///
9 | /// Provides a data source for a data theory, with the data coming from inline values.
10 | ///
11 | [CLSCompliant(false)]
12 | [DataDiscoverer("Xunit.Sdk.InlineDataDiscoverer", "xunit.core")]
13 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
14 | public sealed class InlineDataAttribute : DataAttribute
15 | {
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// The data values to pass to the theory.
20 | public InlineDataAttribute(params object[] data) { }
21 |
22 | ///
23 | public override IEnumerable