├── CONTRIBUTING.md
├── .nuget
├── NuGet.exe
└── NuGet.Config
├── StatePrinter
├── gfx
│ ├── stateprinter.ico
│ └── stateprinter.png
├── StatePrinterStrongNameKeyFile_DoNotDelete.snk
├── Settings.StyleCop
├── OutputFormatters
│ ├── IOutputFormatter.cs
│ ├── StringBuilderTrimmer.cs
│ ├── OutputFormatterHelpers.cs
│ ├── IndentingStringBuilder.cs
│ ├── UnusedReferencesTokenFilter.cs
│ ├── FastestPossibleStyle.cs
│ └── CurlyBraceStyle.cs
├── FieldHarvesters
│ ├── IRunTimeCodeGenerator.cs
│ ├── IFieldHarvester.cs
│ ├── AnonymousFieldHarvester.cs
│ ├── AllFieldsHarvester.cs
│ ├── AllFieldsAndPropertiesHarvester.cs
│ ├── SanitizedFieldInfo.cs
│ ├── PublicFieldsHarvester.cs
│ ├── PublicFieldsAndPropertiesHarvester .cs
│ ├── RunTimeCodeGenerator.cs
│ └── ToStringAwareHarvester.cs
├── Configurations
│ ├── LegacyBehaviour.cs
│ ├── ConfigurationHelper.cs
│ └── TestingBehaviour.cs
├── Introspection
│ ├── TokenType.cs
│ ├── ReflectionInfo.cs
│ ├── Reference.cs
│ ├── HarvestInfoCache.cs
│ └── Token.cs
├── TestAssistance
│ ├── FileRepository.cs
│ ├── EnvironmentReader.cs
│ ├── StringUtils.cs
│ ├── DefaultAssertMessage.cs
│ ├── TestRewriter.cs
│ └── Parser.cs
├── ValueConverters
│ ├── EnumConverter.cs
│ ├── IValueConverter.cs
│ ├── StringConverter.cs
│ ├── GenericValueConverter.cs
│ ├── DateTimeConverter.cs
│ ├── StandardTypesConverter.cs
│ └── RollingGuidValueConverter.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
└── StatePrinter.cs
├── HowToRelease.txt
├── .gitattributes
├── DeployToNuget.cmd
├── CreateNuget.cmd
├── appveyor.yml
├── StatePrinter.nuspec
├── StatePrinter.Tests
├── packages.config
├── ValueConverters
│ └── GenericValueConverterTest.cs
├── PerformanceTests
│ └── PerformanceTestsBase.cs
├── Introspection
│ ├── ReferenceTest.cs
│ └── TokenTest.cs
├── IntegrationTests
│ ├── InheritanceTest.cs
│ ├── ToStringMethodTest.cs
│ ├── CultureTests.cs
│ ├── CallStackReflectorTest.cs
│ ├── TwoDimensionArrayTest.cs
│ └── PublicPropertiesTest.cs
├── Mocks
│ └── Mocks.cs
├── TestingAssistance
│ ├── EnvironmentReaderTest.cs
│ ├── TestingAssistanceReWriteTest.cs
│ ├── USerStory.cs
│ └── ReWriterMockedTests.cs
├── FieldHarvesters
│ ├── AllHarvesterTest.cs
│ ├── AnonymousHarvesterTest.cs
│ ├── ToStringAwareHarvesterTest.cs
│ └── ProjectionHarvesterByTypeTest.cs
├── TestHelper.cs
├── OutputFormatters
│ ├── StringBuilderTrimmerTest.cs
│ ├── RollingGuidValueConverterTest.cs
│ └── TokenFilterTest.cs
├── Properties
│ └── AssemblyInfo.cs
├── Configurations
│ └── ConfigurationTest.cs
└── ExamplesForDocumentation
│ ├── ExampleListAndArrays.cs
│ ├── ExampleEndlessAsserts.cs
│ └── ExampleOnSimpleAsserts.cs
├── doc
└── ComprehensibleTestingOfGuids.md
├── .gitignore
├── StatePrinter.sln
├── CHANGELOG.md
└── README.md
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | All input welcome..
2 |
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbilsted/StatePrinter/HEAD/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/StatePrinter/gfx/stateprinter.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbilsted/StatePrinter/HEAD/StatePrinter/gfx/stateprinter.ico
--------------------------------------------------------------------------------
/StatePrinter/gfx/stateprinter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbilsted/StatePrinter/HEAD/StatePrinter/gfx/stateprinter.png
--------------------------------------------------------------------------------
/StatePrinter/StatePrinterStrongNameKeyFile_DoNotDelete.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kbilsted/StatePrinter/HEAD/StatePrinter/StatePrinterStrongNameKeyFile_DoNotDelete.snk
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/HowToRelease.txt:
--------------------------------------------------------------------------------
1 | Steps for creating a new release
2 | --------------------------------
3 |
4 | * Edit Stateprinter/Properties/Assemblyinfo.cs
5 | * Edit appveyor.yml
6 | * Update CHANGELOG.md
7 | * Update StatePrinter.nuspec
8 | * Run DeployToNuget.cmd
9 | * Add release on github.com
10 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set the default behavior, in case people don't have core.autocrlf set.
2 | * eol=crlf
3 |
4 | # Denote all files that are truly binary and should not be modified.
5 | *.snk binary
6 | *.exe binary
7 |
8 | *.dll binary
9 | *.png binary
10 | *.jpg binary
11 | *.gif binary
12 |
--------------------------------------------------------------------------------
/DeployToNuget.cmd:
--------------------------------------------------------------------------------
1 | REM ON FIRST RUN, RUN THIS (change the key to whatever is found on your profile on www.nuget.org ->
2 | REM .nuget\NuGet.exe setapikey e39ea-get-the-full-key-on-nuget.org
3 |
4 | call CreateNuget.cmd
5 | .nuget\NuGet.exe push nuget_packages\StatePrinter.4.*.*.symbols.nupkg
6 | .nuget\NuGet.exe push nuget_packages\StatePrinter.4.*.*.nupkg
7 |
8 | cd nuget_packages
9 | del /q *
10 | cd ..
11 | rmdir nuget_packages
12 |
13 | pause
--------------------------------------------------------------------------------
/CreateNuget.cmd:
--------------------------------------------------------------------------------
1 | if not exist .\nuget_packages mkdir nuget_packages
2 | if not exist .\distro mkdir distro
3 | xcopy StatePrinter\*.cs distro\src\ /Y /Q /E
4 | xcopy StatePrinter\bin\Debug\*.dll distro\lib\net472\ /Q
5 | xcopy StatePrinter.nuspec distro\ /Q
6 | cd distro
7 |
8 | ..\.nuget\nuget.exe pack StatePrinter.nuspec -symbols -Prop Platform=AnyCPU
9 |
10 | xcopy *.nupkg ..\nuget_packages\ /Y /Q
11 |
12 | pause
13 | cd ..
14 | rmdir distro /s /q
15 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 3.0.{build}
2 | image: Visual Studio 2019
3 | environment:
4 | COVERALLS_REPO_TOKEN:
5 | secure: RoEmApsXRqFebGBxdrnjuuPoy9+DpcTu5v2s5DCJdtrmh6EsYYN2r+A1e1IuhzUZ
6 |
7 | install:
8 | - nuget restore
9 |
10 | build:
11 | project: StatePrinter.sln
12 | verbosity: minimal
13 | # verbosity: detailed
14 |
15 |
16 | after_test:
17 | - packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -filter:"+[StatePrinter]*" -target:"packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe" -targetargs:"StatePrinter.Tests\bin\debug\StatePrinter.Tests.dll /domain:single" -output:"coverage.xml"
18 |
19 | - packages\coveralls.io.1.1.86\tools\coveralls.net.exe --opencover "coverage.xml"
20 |
21 |
--------------------------------------------------------------------------------
/StatePrinter/Settings.StyleCop:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 |
5 |
6 |
7 |
8 |
9 |
10 | False
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | False
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/StatePrinter.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | StatePrinter
5 | 4.0.0
6 |
7 | An open source utility to turn object graphs into strings. Automate your ToString and unit tests asserts.
8 |
9 |
10 | * Requires .NET Framework 4.7.2
11 | * Added `TestingBehaviour.SetAreEqualsMethod()` for easier integration with NUnit v3.x
12 | * Removed all obsolete functionality.
13 |
14 | UnitTest ToString Serialization Approvals Test Testing ApprovalsTest
15 | Copyright 2014-2020
16 | en-US
17 | Kasper B. Graversen
18 | https://github.com/kbilsted/StatePrinter
19 | https://raw.githubusercontent.com/kbilsted/StatePrinter/master/StatePrinter/gfx/stateprinter.png
20 | false
21 |
22 |
23 |
--------------------------------------------------------------------------------
/StatePrinter.Tests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/StatePrinter/OutputFormatters/IOutputFormatter.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Kasper B. Graversen
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing,
14 | // software distributed under the License is distributed on an
15 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | // KIND, either express or implied. See the License for the
17 | // specific language governing permissions and limitations
18 | // under the License.
19 |
20 | using System.Collections.Generic;
21 | using StatePrinting.Introspection;
22 |
23 | namespace StatePrinting.OutputFormatters
24 | {
25 | public interface IOutputFormatter
26 | {
27 | string Print(List tokens);
28 | }
29 | }
--------------------------------------------------------------------------------
/StatePrinter/FieldHarvesters/IRunTimeCodeGenerator.cs:
--------------------------------------------------------------------------------
1 | // Copyright 2014-2020 Kasper B. Graversen
2 | //
3 | // Licensed to the Apache Software Foundation (ASF) under one
4 | // or more contributor license agreements. See the NOTICE file
5 | // distributed with this work for additional information
6 | // regarding copyright ownership. The ASF licenses this file
7 | // to you under the Apache License, Version 2.0 (the
8 | // "License"); you may not use this file except in compliance
9 | // with the License. You may obtain a copy of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing,
14 | // software distributed under the License is distributed on an
15 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | // KIND, either express or implied. See the License for the
17 | // specific language governing permissions and limitations
18 | // under the License.
19 |
20 | using System;
21 | using System.Reflection;
22 |
23 | namespace StatePrinting.FieldHarvesters
24 | {
25 | public interface IRunTimeCodeGenerator
26 | {
27 | Func