├── .editorconfig
├── .gitattributes
├── .gitignore
├── AfterScreenshot.png
├── BeforeScreenshot.png
├── CHANGELOG.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── Icon.pdn
├── LICENSE
├── OptionsScreenshot.png
├── README.md
├── Sandbox
├── .editorconfig
├── AutoMoqTestCases
│ ├── AutoMoqTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── app.config
│ └── packages.config
├── Classes
│ ├── AbstractClass.cs
│ ├── Cases
│ │ ├── ClassWithGenericInterface.cs
│ │ ├── ClassWithMethods.cs
│ │ ├── ClassWithNonInterfaceCtorParam.cs
│ │ ├── ClassWithOddCtorParams.cs
│ │ ├── ConstructorInjectedClassMultiple.cs
│ │ ├── ConstructorInjectedClassSingle.cs
│ │ ├── DerivedPropertyInjectedClass.cs
│ │ ├── MixedInjectedClassMultiple.cs
│ │ ├── MixedInjectedClassSingle.cs
│ │ ├── NotInjectedClass.cs
│ │ ├── NotInjectedClassEmptyCtor.cs
│ │ ├── PropertyInjectedClassMultiple.cs
│ │ ├── PropertyInjectedClassSingle.cs
│ │ ├── SomeService.cs
│ │ └── SomeStruct.cs
│ ├── Class2.cs
│ ├── Classes.csproj
│ ├── CustomMock.cs
│ ├── IGenericInterface.cs
│ ├── IInterface3.cs
│ ├── IInterface4.cs
│ ├── ISomeInterface.cs
│ ├── ISomeOtherInterface.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SomeClass.cs
│ └── packages.config
├── FakeItEasyTestCases
│ ├── FakeItEasyTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── JustMockTestCases
│ ├── JustMockTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── MultipleFrameworkTestCases
│ ├── MultipleFrameworkTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── NSubstituteTestCases
│ ├── NSubstituteTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
├── NUnitTestCases
│ ├── NUnitTestCases.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Reference
│ │ └── ReferenceMixedMultipleTest.cs
│ └── packages.config
├── NUnitUwpTestCases
│ ├── NUnitUwpTestCases.csproj
│ ├── NUnitUwpTestCases.nuget.props
│ ├── NUnitUwpTestCases.nuget.targets
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── NUnitUwpTestCases.rd.xml
│ │ └── SimpleStubs.generated.cs
│ ├── SandboxNUnitUwpTestCases.nuget.props
│ ├── SandboxNUnitUwpTestCases.nuget.targets
│ └── project.lock.json
├── NetCoreAutoMoqTestCases
│ └── NetCoreAutoMoqTestCases.csproj
├── NetCoreJustMockTestCases
│ └── NetCoreJustMockTestCases.csproj
├── NetCoreMoqTestCases
│ └── NetCoreMoqTestCases.csproj
├── NetCoreNSubstituteTestCases
│ └── NetCoreNSubstituteTestCases.csproj
├── NetCoreNUnitTestCases
│ └── NetCoreNUnitTestCases.csproj
├── NetCoreSimpleStubsTestCases
│ ├── NetCoreSimpleStubsTestCases.csproj
│ └── Properties
│ │ └── SimpleStubs.generated.cs
├── NetCoreVSRhinoMocksTestCases
│ └── NetCoreVSRhinoMocksTestCases.csproj
├── NetStandardPropsNUnitNSubstitute
│ ├── NetStandardPropsNUnitNSubstitute.csproj
│ └── TestReferences.props
├── NoFrameworkTestCases
│ ├── NoFrameworkTestCases.csproj
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Sandbox.sln
├── SimpleStubsTestCases
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── SimpleStubs.generated.cs
│ ├── Reference
│ │ └── ReferenceMixedMultipleTest.cs
│ ├── SimpleStubs.json
│ ├── SimpleStubsTestCases.csproj
│ └── packages.config
├── SqlDatabaseTestCases
│ ├── SqlDatabaseTestCases.dbmdl
│ ├── SqlDatabaseTestCases.jfm
│ └── SqlDatabaseTestCases.sqlproj
├── VSRhinoMocksTestCases
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── VSRhinoMocksTestCases.csproj
│ └── packages.config
├── VSTestCases
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Reference
│ │ ├── ReferenceConstructorMultipleTest.cs
│ │ ├── ReferenceMixedMultipleTest.cs
│ │ └── ReferencePropertyMultipleTest.cs
│ ├── VSTestCases.csproj
│ └── packages.config
├── XUnitMoqTestCases
│ └── XUnitMoqTestCases.csproj
└── nuget.config
├── SelfTestFiles
└── Expected
│ ├── NUnit_AutoMoq_ClassWithGenericInterface.cs
│ ├── NUnit_FakeItEasy_ClassWithGenericInterface.cs
│ ├── NUnit_JustMock_ClassWithGenericInterface.cs
│ ├── NUnit_Moq_ClassWithGenericInterface.cs
│ ├── NUnit_Moq_ClassWithMethods.cs
│ ├── NUnit_Moq_ClassWithNonInterfaceCtorParam.cs
│ ├── NUnit_Moq_ClassWithOddCtorParams.cs
│ ├── NUnit_Moq_ConstructorInjectedClassMultiple.cs
│ ├── NUnit_Moq_ConstructorInjectedClassSingle.cs
│ ├── NUnit_Moq_DerivedPropertyInjectedClass.cs
│ ├── NUnit_Moq_MixedInjectedClassMultiple.cs
│ ├── NUnit_Moq_MixedInjectedClassSingle.cs
│ ├── NUnit_Moq_NotInjectedClass.cs
│ ├── NUnit_Moq_NotInjectedClassEmptyCtor.cs
│ ├── NUnit_Moq_PropertyInjectedClassMultiple.cs
│ ├── NUnit_Moq_PropertyInjectedClassSingle.cs
│ ├── NUnit_Moq_SomeService.cs
│ ├── NUnit_Moq_SomeStruct.cs
│ ├── NUnit_NSubstitute_ClassWithGenericInterface.cs
│ ├── NUnit_None_ClassWithGenericInterface.cs
│ ├── NUnit_Rhino Mocks_ClassWithGenericInterface.cs
│ ├── NUnit_SimpleStubs_ClassWithGenericInterface.cs
│ ├── VisualStudio_AutoMoq_ClassWithGenericInterface.cs
│ ├── VisualStudio_AutoMoq_ClassWithMethods.cs
│ ├── VisualStudio_AutoMoq_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_AutoMoq_ClassWithOddCtorParams.cs
│ ├── VisualStudio_AutoMoq_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_AutoMoq_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_AutoMoq_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_AutoMoq_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_AutoMoq_MixedInjectedClassSingle.cs
│ ├── VisualStudio_AutoMoq_NotInjectedClass.cs
│ ├── VisualStudio_AutoMoq_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_AutoMoq_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_AutoMoq_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_AutoMoq_SomeService.cs
│ ├── VisualStudio_AutoMoq_SomeStruct.cs
│ ├── VisualStudio_FakeItEasy_ClassWithGenericInterface.cs
│ ├── VisualStudio_FakeItEasy_ClassWithMethods.cs
│ ├── VisualStudio_FakeItEasy_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_FakeItEasy_ClassWithOddCtorParams.cs
│ ├── VisualStudio_FakeItEasy_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_FakeItEasy_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_FakeItEasy_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_FakeItEasy_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_FakeItEasy_MixedInjectedClassSingle.cs
│ ├── VisualStudio_FakeItEasy_NotInjectedClass.cs
│ ├── VisualStudio_FakeItEasy_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_FakeItEasy_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_FakeItEasy_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_FakeItEasy_SomeService.cs
│ ├── VisualStudio_FakeItEasy_SomeStruct.cs
│ ├── VisualStudio_JustMock_ClassWithGenericInterface.cs
│ ├── VisualStudio_JustMock_ClassWithMethods.cs
│ ├── VisualStudio_JustMock_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_JustMock_ClassWithOddCtorParams.cs
│ ├── VisualStudio_JustMock_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_JustMock_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_JustMock_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_JustMock_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_JustMock_MixedInjectedClassSingle.cs
│ ├── VisualStudio_JustMock_NotInjectedClass.cs
│ ├── VisualStudio_JustMock_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_JustMock_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_JustMock_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_JustMock_SomeService.cs
│ ├── VisualStudio_JustMock_SomeStruct.cs
│ ├── VisualStudio_Moq_ClassWithGenericInterface.cs
│ ├── VisualStudio_Moq_ClassWithMethods.cs
│ ├── VisualStudio_Moq_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_Moq_ClassWithOddCtorParams.cs
│ ├── VisualStudio_Moq_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_Moq_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_Moq_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_Moq_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_Moq_MixedInjectedClassSingle.cs
│ ├── VisualStudio_Moq_NotInjectedClass.cs
│ ├── VisualStudio_Moq_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_Moq_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_Moq_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_Moq_SomeService.cs
│ ├── VisualStudio_Moq_SomeStruct.cs
│ ├── VisualStudio_NSubstitute_ClassWithGenericInterface.cs
│ ├── VisualStudio_NSubstitute_ClassWithMethods.cs
│ ├── VisualStudio_NSubstitute_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_NSubstitute_ClassWithOddCtorParams.cs
│ ├── VisualStudio_NSubstitute_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_NSubstitute_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_NSubstitute_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_NSubstitute_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_NSubstitute_MixedInjectedClassSingle.cs
│ ├── VisualStudio_NSubstitute_NotInjectedClass.cs
│ ├── VisualStudio_NSubstitute_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_NSubstitute_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_NSubstitute_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_NSubstitute_SomeService.cs
│ ├── VisualStudio_NSubstitute_SomeStruct.cs
│ ├── VisualStudio_None_ClassWithGenericInterface.cs
│ ├── VisualStudio_None_ClassWithMethods.cs
│ ├── VisualStudio_None_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_None_ClassWithOddCtorParams.cs
│ ├── VisualStudio_None_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_None_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_None_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_None_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_None_MixedInjectedClassSingle.cs
│ ├── VisualStudio_None_NotInjectedClass.cs
│ ├── VisualStudio_None_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_None_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_None_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_None_SomeService.cs
│ ├── VisualStudio_None_SomeStruct.cs
│ ├── VisualStudio_Rhino Mocks_ClassWithGenericInterface.cs
│ ├── VisualStudio_Rhino Mocks_ClassWithMethods.cs
│ ├── VisualStudio_Rhino Mocks_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_Rhino Mocks_ClassWithOddCtorParams.cs
│ ├── VisualStudio_Rhino Mocks_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_Rhino Mocks_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_Rhino Mocks_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_Rhino Mocks_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_Rhino Mocks_MixedInjectedClassSingle.cs
│ ├── VisualStudio_Rhino Mocks_NotInjectedClass.cs
│ ├── VisualStudio_Rhino Mocks_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_Rhino Mocks_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_Rhino Mocks_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_Rhino Mocks_SomeService.cs
│ ├── VisualStudio_Rhino Mocks_SomeStruct.cs
│ ├── VisualStudio_SimpleStubs_ClassWithGenericInterface.cs
│ ├── VisualStudio_SimpleStubs_ClassWithMethods.cs
│ ├── VisualStudio_SimpleStubs_ClassWithNonInterfaceCtorParam.cs
│ ├── VisualStudio_SimpleStubs_ClassWithOddCtorParams.cs
│ ├── VisualStudio_SimpleStubs_ConstructorInjectedClassMultiple.cs
│ ├── VisualStudio_SimpleStubs_ConstructorInjectedClassSingle.cs
│ ├── VisualStudio_SimpleStubs_DerivedPropertyInjectedClass.cs
│ ├── VisualStudio_SimpleStubs_MixedInjectedClassMultiple.cs
│ ├── VisualStudio_SimpleStubs_MixedInjectedClassSingle.cs
│ ├── VisualStudio_SimpleStubs_NotInjectedClass.cs
│ ├── VisualStudio_SimpleStubs_NotInjectedClassEmptyCtor.cs
│ ├── VisualStudio_SimpleStubs_PropertyInjectedClassMultiple.cs
│ ├── VisualStudio_SimpleStubs_PropertyInjectedClassSingle.cs
│ ├── VisualStudio_SimpleStubs_SomeService.cs
│ ├── VisualStudio_SimpleStubs_SomeStruct.cs
│ ├── xUnit_AutoMoq_ClassWithGenericInterface.cs
│ ├── xUnit_FakeItEasy_ClassWithGenericInterface.cs
│ ├── xUnit_JustMock_ClassWithGenericInterface.cs
│ ├── xUnit_Moq_ClassWithGenericInterface.cs
│ ├── xUnit_Moq_ClassWithMethods.cs
│ ├── xUnit_Moq_ClassWithNonInterfaceCtorParam.cs
│ ├── xUnit_Moq_ClassWithOddCtorParams.cs
│ ├── xUnit_Moq_ConstructorInjectedClassMultiple.cs
│ ├── xUnit_Moq_ConstructorInjectedClassSingle.cs
│ ├── xUnit_Moq_DerivedPropertyInjectedClass.cs
│ ├── xUnit_Moq_MixedInjectedClassMultiple.cs
│ ├── xUnit_Moq_MixedInjectedClassSingle.cs
│ ├── xUnit_Moq_NotInjectedClass.cs
│ ├── xUnit_Moq_NotInjectedClassEmptyCtor.cs
│ ├── xUnit_Moq_PropertyInjectedClassMultiple.cs
│ ├── xUnit_Moq_PropertyInjectedClassSingle.cs
│ ├── xUnit_Moq_SomeService.cs
│ ├── xUnit_Moq_SomeStruct.cs
│ ├── xUnit_NSubstitute_ClassWithGenericInterface.cs
│ ├── xUnit_None_ClassWithGenericInterface.cs
│ ├── xUnit_Rhino Mocks_ClassWithGenericInterface.cs
│ └── xUnit_SimpleStubs_ClassWithGenericInterface.cs
├── ThirdPartyLicenses.txt
├── UnitTestBoilerplate.sln
├── appveyor.yml
├── nuget.config
└── src
├── Commands
├── CreateUnitTestBoilerplateCommand.cs
├── SelfTestCleanCommand.cs
└── SelfTestCommand.cs
├── Converters
└── VisibilityConverter.cs
├── CreateUnitTestBoilerplateCommandPackage.cs
├── CreateUnitTestBoilerplateCommandPackage_Debug.vsct
├── CreateUnitTestBoilerplateCommandPackage_Release.vsct
├── DefaultTemplateGenerator.cs
├── Extensions.cs
├── Key.snk
├── Model
├── BoilerplateSettingsJson.cs
├── ComboChoice.cs
├── ISettingsPageViewModel.cs
├── InjectableProperty.cs
├── InjectableType.cs
├── MethodArgumentDescriptor.cs
├── MethodDescriptor.cs
├── MockField.cs
├── MockFramework.cs
├── MockFrameworks.cs
├── ProjectItemSummary.cs
├── SelfTestDetectionResult.cs
├── SelfTestDetectionTest.cs
├── SelfTestDetectionsResult.cs
├── SelfTestFileComparesResult.cs
├── SelfTestFileFailure.cs
├── SelfTestInputCombination.cs
├── SelfTestRunResult.cs
├── TemplateType.cs
├── TestCleanupStyle.cs
├── TestFramework.cs
├── TestFrameworks.cs
├── TestGenerationContext.cs
├── TestInitializeStyle.cs
├── TestProject.cs
├── TestedObjectCreationStyle.cs
└── TypeDescriptor.cs
├── Properties
└── AssemblyInfo.cs
├── Resources
├── CreateUnitTestBoilerplateCommand.png
├── CreateUnitTestBoilerplateCommandPackage.ico
├── PackageIcon-90x90.png
└── Preview.png
├── Services
├── BoilerplateCache.cs
├── BoilerplateSettings.cs
├── BoilerplateSettingsFactory.cs
├── FrameworkPickerService.cs
├── IBoilerplateCache.cs
├── IBoilerplateSettings.cs
├── IBoilerplateSettingsFactory.cs
├── IBoilerplateSettingsStore.cs
├── IFrameworkPickerService.cs
├── ISettingsCoordinator.cs
├── ITestGenerationService.cs
├── MockBoilerplateSettings.cs
├── MockBoilerplateSettingsFactory.cs
├── PersonalBoilerplateSettingsStore.cs
├── SelfTestService.cs
├── SettingsCoordinator.cs
├── TestGenerationService.cs
└── WorkspaceBoilerplateSettingsStore.cs
├── UnitTestBoilerplate.csproj
├── Utilities
├── FileUtilities.cs
├── SolutionUtilities.cs
├── StringUtilities.cs
└── TypeUtilities.cs
├── VSPackage.resx
├── View
├── CreateUnitTestBoilerplateDialog.xaml
├── CreateUnitTestBoilerplateDialog.xaml.cs
├── FileContentsOptionsDialogPage.cs
├── FileContentsOptionsDialogPageControl.xaml
├── FileContentsOptionsDialogPageControl.xaml.cs
├── OtherOptionsDialogPage.cs
├── OtherOptionsDialogPageControl.xaml
├── OtherOptionsDialogPageControl.xaml.cs
├── SelfTestDialog.xaml
├── SelfTestDialog.xaml.cs
├── WorkspaceSettingsDialogPage.cs
├── WorkspaceSettingsDialogPageControl.xaml
├── WorkspaceSettingsDialogPageControl.xaml.cs
└── XamlResources.xaml
├── ViewModel
├── CreateUnitTestBoilerplateViewModel.cs
├── CustomMockViewModel.cs
├── FileContentsOptionsDialogViewModel.cs
├── OtherOptionsDialogViewModel.cs
├── SelfTestViewModel.cs
├── SideBySideDiffModelVisualizer.cs
└── WorkspaceSettingsDialogViewModel.cs
├── app.config
├── index.html
├── source.extension.vsixmanifest
└── stylesheet.css
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 | indent_style = tab
3 | tab_size = 4
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # For .txt template files, keep the CRLF
5 | *.txt eol=crlf
6 |
7 | # Custom for Visual Studio
8 | *.cs diff=csharp
9 | *.sln merge=union
10 | *.csproj merge=union
11 | *.vbproj merge=union
12 | *.fsproj merge=union
13 | *.dbproj merge=union
14 |
15 | # Standard to msysgit
16 | *.doc diff=astextplain
17 | *.DOC diff=astextplain
18 | *.docx diff=astextplain
19 | *.DOCX diff=astextplain
20 | *.dot diff=astextplain
21 | *.DOT diff=astextplain
22 | *.pdf diff=astextplain
23 | *.PDF diff=astextplain
24 | *.rtf diff=astextplain
25 | *.RTF diff=astextplain
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | packages
2 |
3 | # User files
4 | *.suo
5 | *.user
6 | *.sln.docstates
7 | .vs/
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Rr]elease/
12 | x64/
13 | [Bb]in/
14 | [Oo]bj/
15 |
16 | # MSTest test Results
17 | [Tt]est[Rr]esult*/
18 | [Bb]uild[Ll]og.*
19 |
20 | # NCrunch
21 | *.ncrunchsolution
22 | *.ncrunchproject
23 | _NCrunch_WebCompiler
24 |
25 | # Self-test results
26 | /SelfTestFiles/Actual
--------------------------------------------------------------------------------
/AfterScreenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/AfterScreenshot.png
--------------------------------------------------------------------------------
/BeforeScreenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/BeforeScreenshot.png
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Installed product versions
2 | - Visual Studio: [example 2015 Professional]
3 | - This extension: [example 1.1.21]
4 |
5 | ### Description
6 | Replace this text with a short description
7 |
8 | ### Steps to recreate
9 | 1. Replace this
10 | 2. text with
11 | 3. the steps
12 | 4. to recreate
13 |
14 | ### Current behavior
15 | Explain what it's doing and why it's wrong
16 |
17 | ### Expected behavior
18 | Explain what it should be doing after it's fixed.
--------------------------------------------------------------------------------
/Icon.pdn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/Icon.pdn
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Microsoft
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4 | and associated documentation files (the "Software"), to deal in the Software without restriction,
5 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
6 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to
7 | do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all copies or substantial
10 | portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
14 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
15 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/OptionsScreenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/OptionsScreenshot.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Moved to https://github.com/RandomEngy/UnitTestBoilerplateGenerator
2 |
--------------------------------------------------------------------------------
/Sandbox/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 | indent_style = tab
3 | tab_size = 4
--------------------------------------------------------------------------------
/Sandbox/AutoMoqTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("SandboxAutoMoqTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("SandboxAutoMoqTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2017")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("cf35042f-b6db-42b2-96e8-46fa5f114b9e")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/AutoMoqTestCases/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sandbox/AutoMoqTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sandbox/Classes/AbstractClass.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public abstract class AbstractClass
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Practices.Unity;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes.Cases
9 | {
10 | public class ClassWithGenericInterface
11 | {
12 | public ClassWithGenericInterface(IGenericInterface theGenericInterface, IGenericInterface> theOtherGenericInterface, ISomeInterface someInterface)
13 | {
14 | }
15 |
16 | [Dependency]
17 | public IInterface3 Interface2 { get; set; }
18 |
19 | [Dependency]
20 | public IGenericInterface> GenericInterface3 { get; set; }
21 |
22 | [Dependency]
23 | public IGenericInterface> GenericInterface4 { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/ClassWithNonInterfaceCtorParam.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class ClassWithNonInterfaceCtorParam
10 | {
11 | public ClassWithNonInterfaceCtorParam(SomeClass theClass)
12 | {
13 |
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/ClassWithOddCtorParams.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class ClassWithOddCtorParams
10 | {
11 | public ClassWithOddCtorParams(int test, DateTime date)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/ConstructorInjectedClassMultiple.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class ConstructorInjectedClassMultiple
10 | {
11 | private readonly ISomeInterface someInterface;
12 | private readonly ISomeOtherInterface someOtherInterface;
13 |
14 | public ConstructorInjectedClassMultiple(ISomeInterface someInterface, ISomeOtherInterface someOtherInterface)
15 | {
16 | this.someInterface = someInterface;
17 | this.someOtherInterface = someOtherInterface;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/ConstructorInjectedClassSingle.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class ConstructorInjectedClassSingle
10 | {
11 | private readonly ISomeInterface someInterface;
12 |
13 | public ConstructorInjectedClassSingle(ISomeInterface someInterface)
14 | {
15 | this.someInterface = someInterface;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Practices.Unity;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes.Cases
9 | {
10 | public class DerivedPropertyInjectedClass : PropertyInjectedClassMultiple
11 | {
12 | [Dependency]
13 | public IInterface3 Interface3Property { protected get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Practices.Unity;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes.Cases
9 | {
10 | public class MixedInjectedClassMultiple
11 | {
12 | private readonly ISomeInterface someInterface;
13 | private readonly ISomeOtherInterface someOtherInterface;
14 |
15 | public MixedInjectedClassMultiple(ISomeInterface someInterface, ISomeOtherInterface someOtherInterface)
16 | {
17 | this.someInterface = someInterface;
18 | this.someOtherInterface = someOtherInterface;
19 | }
20 |
21 | [Dependency]
22 | public IInterface3 Interface3Property { get; set; }
23 |
24 | [Dependency]
25 | public IInterface4 Interface4Property { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Practices.Unity;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes.Cases
9 | {
10 | public class MixedInjectedClassSingle
11 | {
12 | private readonly ISomeInterface someInterface;
13 |
14 | public MixedInjectedClassSingle(ISomeInterface someInterface)
15 | {
16 | this.someInterface = someInterface;
17 | }
18 |
19 | [Dependency]
20 | public IInterface3 Interface3Property { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/NotInjectedClass.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class NotInjectedClass
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/NotInjectedClassEmptyCtor.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class NotInjectedClassEmptyCtor
10 | {
11 | public NotInjectedClassEmptyCtor()
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Microsoft.Practices.Unity;
6 |
7 | namespace UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class PropertyInjectedClassMultiple
10 | {
11 | [Dependency]
12 | public ISomeInterface MyProperty { protected get; set; }
13 |
14 | [Dependency]
15 | public ISomeOtherInterface Property2 { protected get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Practices.Unity;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes.Cases
9 | {
10 | public class PropertyInjectedClassSingle
11 | {
12 | [Dependency]
13 | public ISomeInterface MyProperty { protected get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/SomeService.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public class SomeService
10 | {
11 | private readonly ISomeInterface someInterface;
12 | private readonly ISomeOtherInterface someOtherInterface;
13 |
14 | public SomeService(ISomeInterface someInterface, ISomeOtherInterface someOtherInterface)
15 | {
16 | this.someInterface = someInterface;
17 | this.someOtherInterface = someOtherInterface;
18 | }
19 |
20 | public int AddNumbers(int a, int b)
21 | {
22 | return a + b;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Cases/SomeStruct.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 UnitBoilerplate.Sandbox.Classes.Cases
8 | {
9 | public struct SomeStruct
10 | {
11 | private readonly int a;
12 | private readonly int b;
13 |
14 | public SomeStruct(int a, int b)
15 | {
16 | this.a = a;
17 | this.b = b;
18 | }
19 |
20 | public int GetValue(int c)
21 | {
22 | return a + b + c;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Class2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Practices.Unity;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace UnitBoilerplate.Sandbox.Classes
9 | {
10 | public class Class2
11 | {
12 | [Dependency]
13 | public ISomeInterface MyProperty { protected get; set; }
14 |
15 | [Dependency]
16 | public ISomeOtherInterface Property2 { protected get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sandbox/Classes/CustomMock.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public class CustomMock : ISomeInterface
10 | {
11 | public void DoAThing()
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sandbox/Classes/IGenericInterface.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public interface IGenericInterface
10 | {
11 | T GetAThing();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sandbox/Classes/IInterface3.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public interface IInterface3
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/IInterface4.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public interface IInterface4
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/ISomeInterface.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public interface ISomeInterface
10 | {
11 | void DoAThing();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Sandbox/Classes/ISomeOtherInterface.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public interface ISomeOtherInterface
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Resources;
2 | using System.Reflection;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("UnitBoilerplateSandbox")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("UnitBoilerplateSandbox")]
14 | [assembly: AssemblyCopyright("Copyright © 2016")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: NeutralResourcesLanguage("en")]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/Sandbox/Classes/SomeClass.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 UnitBoilerplate.Sandbox.Classes
8 | {
9 | public class SomeClass
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/Classes/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Sandbox/FakeItEasyTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("FakeItEasyTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("FakeItEasyTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2019")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("ef1b5a74-5868-4560-87ce-a2824bea5b0b")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/FakeItEasyTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/JustMockTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("JustMockTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("JustMockTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2020")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("69633b60-f61e-4c38-8672-5d9e16639c89")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/JustMockTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/MultipleFrameworkTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("MultipleFrameworkTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("MultipleFrameworkTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2018")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("fcec9c55-9e6e-410d-a2ac-0ada4979ae2f")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/MultipleFrameworkTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sandbox/NSubstituteTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("SandboxNSubstituteTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("SandboxNSubstituteTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2017")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("adb2b56b-09d3-4415-ba1d-b8cbda659a42")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/NSubstituteTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/NUnitTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/NUnitUwpTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("NUnitUwpTestCases")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NUnitUwpTestCases")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/Sandbox/NetCoreAutoMoqTestCases/NetCoreAutoMoqTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | ..\..\packages\MSTest.TestFramework.1.0.8-rc2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreJustMockTestCases/NetCoreJustMockTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreMoqTestCases/NetCoreMoqTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreNSubstituteTestCases/NetCoreNSubstituteTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreNUnitTestCases/NetCoreNUnitTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreSimpleStubsTestCases/NetCoreSimpleStubsTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Sandbox/NetCoreVSRhinoMocksTestCases/NetCoreVSRhinoMocksTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Sandbox/NetStandardPropsNUnitNSubstitute/NetStandardPropsNUnitNSubstitute.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sandbox/NetStandardPropsNUnitNSubstitute/TestReferences.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sandbox/SimpleStubsTestCases/Reference/ReferenceMixedMultipleTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitBoilerplate.Sandbox.SimpleStubsTestCases.Reference
7 | {
8 | [TestClass]
9 | public class ReferenceMixedMultipleTest
10 | {
11 | private StubISomeInterface stubSomeInterface;
12 | private StubISomeOtherInterface stubSomeOtherInterface;
13 | private StubIInterface3 stubInterface3;
14 | private StubIInterface4 stubInterface4;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.stubSomeInterface = new StubISomeInterface();
20 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
21 | this.stubInterface3 = new StubIInterface3();
22 | this.stubInterface4 = new StubIInterface4();
23 | }
24 |
25 | private MixedInjectedClassMultiple CreateViewModel()
26 | {
27 | return new MixedInjectedClassMultiple(
28 | this.stubSomeInterface,
29 | this.stubSomeOtherInterface)
30 | {
31 | Interface3Property = this.stubInterface3,
32 | Interface4Property = this.stubInterface4,
33 | };
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Sandbox/SimpleStubsTestCases/SimpleStubs.json:
--------------------------------------------------------------------------------
1 | {
2 | "IgnoredProjects": [
3 | ],
4 | "IgnoredInterfaces": [
5 | ],
6 | "StubInternalInterfaces": false,
7 | "DefaultMockBehavior": "Loose"
8 | }
--------------------------------------------------------------------------------
/Sandbox/SimpleStubsTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Sandbox/SqlDatabaseTestCases/SqlDatabaseTestCases.dbmdl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/Sandbox/SqlDatabaseTestCases/SqlDatabaseTestCases.dbmdl
--------------------------------------------------------------------------------
/Sandbox/SqlDatabaseTestCases/SqlDatabaseTestCases.jfm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/Sandbox/SqlDatabaseTestCases/SqlDatabaseTestCases.jfm
--------------------------------------------------------------------------------
/Sandbox/VSRhinoMocksTestCases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("VSRhinoMocksTestCases")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("VSRhinoMocksTestCases")]
10 | [assembly: AssemblyCopyright("Copyright © 2017")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("356f3a4b-2177-479b-9531-f2f76bdbfa3b")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/Sandbox/VSRhinoMocksTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/VSTestCases/Reference/ReferenceConstructorMultipleTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitBoilerplate.Sandbox.VSTestCases.Reference
8 | {
9 | [TestClass]
10 | public class ReferenceConstructorMultipleTest
11 | {
12 | private MockRepository mockRepository;
13 |
14 | private Mock mockSomeInterface;
15 | private Mock mockSomeOtherInterface;
16 |
17 | [TestInitialize]
18 | public void TestInitialize()
19 | {
20 | this.mockRepository = new MockRepository(MockBehavior.Strict);
21 |
22 | this.mockSomeInterface = this.mockRepository.Create();
23 | this.mockSomeOtherInterface = this.mockRepository.Create();
24 | }
25 |
26 | private ConstructorInjectedClassMultiple CreateViewModel()
27 | {
28 | return new ConstructorInjectedClassMultiple(
29 | this.mockSomeInterface.Object,
30 | this.mockSomeOtherInterface.Object);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Sandbox/VSTestCases/Reference/ReferencePropertyMultipleTest.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitBoilerplate.Sandbox.VSTestCases.Reference
8 | {
9 | [TestClass]
10 | public class ReferencePropertyMultipleTest
11 | {
12 | private MockRepository mockRepository;
13 |
14 | private Mock mockSomeInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | }
23 |
24 | private PropertyInjectedClassMultiple CreateViewModel()
25 | {
26 | return new PropertyInjectedClassMultiple
27 | {
28 | MyProperty = this.mockSomeInterface.Object
29 | };
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Sandbox/VSTestCases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Sandbox/XUnitMoqTestCases/XUnitMoqTestCases.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | all
15 | runtime; build; native; contentfiles; analyzers
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Sandbox/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_AutoMoq_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Moq;
3 | using NUnit.Framework;
4 | using System.Collections.Generic;
5 | using UnitBoilerplate.Sandbox.Classes;
6 | using UnitBoilerplate.Sandbox.Classes.Cases;
7 |
8 | namespace UnitTestBoilerplate.SelfTest.Cases
9 | {
10 | [TestFixture]
11 | public class ClassWithGenericInterfaceTests
12 | {
13 | [Test]
14 | public void TestMethod1()
15 | {
16 | // Arrange
17 | var mocker = new AutoMoqer();
18 | var classWithGenericInterface = mocker.Create();
19 |
20 | // Act
21 |
22 |
23 | // Assert
24 | Assert.Fail();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeClass;
14 |
15 | [SetUp]
16 | public void SetUp()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeClass = this.mockRepository.Create();
21 | }
22 |
23 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
24 | {
25 | return new ClassWithNonInterfaceCtorParam(
26 | this.mockSomeClass.Object);
27 | }
28 |
29 | [Test]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestFixture]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [SetUp]
15 | public void SetUp()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
23 | {
24 | return new ClassWithOddCtorParams(
25 | TODO,
26 | TODO);
27 | }
28 |
29 | [Test]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | [SetUp]
17 | public void SetUp()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | this.mockSomeOtherInterface = this.mockRepository.Create();
23 | }
24 |
25 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
26 | {
27 | return new ConstructorInjectedClassMultiple(
28 | this.mockSomeInterface.Object,
29 | this.mockSomeOtherInterface.Object);
30 | }
31 |
32 | [Test]
33 | public void TestMethod1()
34 | {
35 | // Arrange
36 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
37 |
38 | // Act
39 |
40 |
41 | // Assert
42 | Assert.Fail();
43 | this.mockRepository.VerifyAll();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | [SetUp]
16 | public void SetUp()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | }
22 |
23 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
24 | {
25 | return new ConstructorInjectedClassSingle(
26 | this.mockSomeInterface.Object);
27 | }
28 |
29 | [Test]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class DerivedPropertyInjectedClassTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockInterface3;
14 | private Mock mockSomeInterface;
15 | private Mock mockSomeOtherInterface;
16 |
17 | [SetUp]
18 | public void SetUp()
19 | {
20 | this.mockRepository = new MockRepository(MockBehavior.Strict);
21 |
22 | this.mockInterface3 = this.mockRepository.Create();
23 | this.mockSomeInterface = this.mockRepository.Create();
24 | this.mockSomeOtherInterface = this.mockRepository.Create();
25 | }
26 |
27 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
28 | {
29 | return new DerivedPropertyInjectedClass
30 | {
31 | Interface3Property = this.mockInterface3.Object,
32 | MyProperty = this.mockSomeInterface.Object,
33 | Property2 = this.mockSomeOtherInterface.Object,
34 | };
35 | }
36 |
37 | [Test]
38 | public void TestMethod1()
39 | {
40 | // Arrange
41 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
42 |
43 | // Act
44 |
45 |
46 | // Assert
47 | Assert.Fail();
48 | this.mockRepository.VerifyAll();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockInterface3;
14 | private Mock mockSomeInterface;
15 |
16 | [SetUp]
17 | public void SetUp()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockInterface3 = this.mockRepository.Create();
22 | this.mockSomeInterface = this.mockRepository.Create();
23 | }
24 |
25 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
26 | {
27 | return new MixedInjectedClassSingle(
28 | this.mockSomeInterface.Object)
29 | {
30 | Interface3Property = this.mockInterface3.Object,
31 | };
32 | }
33 |
34 | [Test]
35 | public void TestMethod1()
36 | {
37 | // Arrange
38 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
39 |
40 | // Act
41 |
42 |
43 | // Assert
44 | Assert.Fail();
45 | this.mockRepository.VerifyAll();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestFixture]
8 | public class NotInjectedClassTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [SetUp]
15 | public void SetUp()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private NotInjectedClass CreateNotInjectedClass()
23 | {
24 | return new NotInjectedClass();
25 | }
26 |
27 | [Test]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var notInjectedClass = this.CreateNotInjectedClass();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | this.mockRepository.VerifyAll();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestFixture]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [SetUp]
15 | public void SetUp()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
23 | {
24 | return new NotInjectedClassEmptyCtor();
25 | }
26 |
27 | [Test]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | this.mockRepository.VerifyAll();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | [SetUp]
17 | public void SetUp()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | this.mockSomeOtherInterface = this.mockRepository.Create();
23 | }
24 |
25 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
26 | {
27 | return new PropertyInjectedClassMultiple
28 | {
29 | MyProperty = this.mockSomeInterface.Object,
30 | Property2 = this.mockSomeOtherInterface.Object,
31 | };
32 | }
33 |
34 | [Test]
35 | public void TestMethod1()
36 | {
37 | // Arrange
38 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
39 |
40 | // Act
41 |
42 |
43 | // Assert
44 | Assert.Fail();
45 | this.mockRepository.VerifyAll();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | [SetUp]
16 | public void SetUp()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | }
22 |
23 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
24 | {
25 | return new PropertyInjectedClassSingle
26 | {
27 | MyProperty = this.mockSomeInterface.Object,
28 | };
29 | }
30 |
31 | [Test]
32 | public void TestMethod1()
33 | {
34 | // Arrange
35 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
36 |
37 | // Act
38 |
39 |
40 | // Assert
41 | Assert.Fail();
42 | this.mockRepository.VerifyAll();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestFixture]
10 | public class SomeServiceTests
11 | {
12 | private MockRepository mockRepository;
13 |
14 | private Mock mockSomeInterface;
15 | private Mock mockSomeOtherInterface;
16 |
17 | [SetUp]
18 | public void SetUp()
19 | {
20 | this.mockRepository = new MockRepository(MockBehavior.Strict);
21 |
22 | this.mockSomeInterface = this.mockRepository.Create();
23 | this.mockSomeOtherInterface = this.mockRepository.Create();
24 | }
25 |
26 | private SomeService CreateService()
27 | {
28 | return new SomeService(
29 | this.mockSomeInterface.Object,
30 | this.mockSomeOtherInterface.Object);
31 | }
32 |
33 | [Test]
34 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
35 | {
36 | // Arrange
37 | var service = this.CreateService();
38 | int a = 0;
39 | int b = 0;
40 |
41 | // Act
42 | var result = service.AddNumbers(
43 | a,
44 | b);
45 |
46 | // Assert
47 | Assert.Fail();
48 | this.mockRepository.VerifyAll();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_Moq_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using NUnit.Framework;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class SomeStructTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 |
14 |
15 | [SetUp]
16 | public void SetUp()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 |
21 | }
22 |
23 | private SomeStruct CreateSomeStruct()
24 | {
25 | return new SomeStruct(
26 | TODO,
27 | TODO);
28 | }
29 |
30 | [Test]
31 | public void GetValue_StateUnderTest_ExpectedBehavior()
32 | {
33 | // Arrange
34 | var someStruct = this.CreateSomeStruct();
35 | int c = 0;
36 |
37 | // Act
38 | var result = someStruct.GetValue(
39 | c);
40 |
41 | // Assert
42 | Assert.Fail();
43 | this.mockRepository.VerifyAll();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_None_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using System.Collections.Generic;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestFixture]
9 | public class ClassWithGenericInterfaceTests
10 | {
11 | [Test]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var classWithGenericInterface = new ClassWithGenericInterface(TODO, TODO, TODO);
16 |
17 | // Act
18 |
19 |
20 | // Assert
21 | Assert.Fail();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/NUnit_SimpleStubs_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestFixture]
8 | public class ClassWithGenericInterfaceTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubISomeInterface stubSomeInterface;
12 |
13 | [SetUp]
14 | public void SetUp()
15 | {
16 | this.stubInterface3 = new StubIInterface3();
17 | this.stubSomeInterface = new StubISomeInterface();
18 | }
19 |
20 | private ClassWithGenericInterface CreateClassWithGenericInterface()
21 | {
22 | return new ClassWithGenericInterface(
23 | TODO,
24 | TODO,
25 | this.stubSomeInterface)
26 | {
27 | Interface2 = this.stubInterface3,
28 | };
29 | }
30 |
31 | [Test]
32 | public void TestMethod1()
33 | {
34 | // Arrange
35 | var classWithGenericInterface = this.CreateClassWithGenericInterface();
36 |
37 | // Act
38 |
39 |
40 | // Assert
41 | Assert.Fail();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using System.Collections.Generic;
5 | using UnitBoilerplate.Sandbox.Classes;
6 | using UnitBoilerplate.Sandbox.Classes.Cases;
7 |
8 | namespace UnitTestBoilerplate.SelfTest.Cases
9 | {
10 | [TestClass]
11 | public class ClassWithGenericInterfaceTests
12 | {
13 | [TestMethod]
14 | public void TestMethod1()
15 | {
16 | // Arrange
17 | var mocker = new AutoMoqer();
18 | var classWithGenericInterface = mocker.Create();
19 |
20 | // Act
21 |
22 |
23 | // Assert
24 | Assert.Fail();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class ClassWithNonInterfaceCtorParamTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var classWithNonInterfaceCtorParam = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithOddCtorParamsTests
10 | {
11 | [TestMethod]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var mocker = new AutoMoqer();
16 | var classWithOddCtorParams = mocker.Create();
17 |
18 | // Act
19 |
20 |
21 | // Assert
22 | Assert.Fail();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class ConstructorInjectedClassMultipleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var constructorInjectedClassMultiple = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class ConstructorInjectedClassSingleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var constructorInjectedClassSingle = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class DerivedPropertyInjectedClassTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var derivedPropertyInjectedClass = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class MixedInjectedClassMultipleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var mixedInjectedClassMultiple = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class MixedInjectedClassSingleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var mixedInjectedClassSingle = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class NotInjectedClassTests
10 | {
11 | [TestMethod]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var mocker = new AutoMoqer();
16 | var notInjectedClass = mocker.Create();
17 |
18 | // Act
19 |
20 |
21 | // Assert
22 | Assert.Fail();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class NotInjectedClassEmptyCtorTests
10 | {
11 | [TestMethod]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var mocker = new AutoMoqer();
16 | var notInjectedClassEmptyCtor = mocker.Create();
17 |
18 | // Act
19 |
20 |
21 | // Assert
22 | Assert.Fail();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class PropertyInjectedClassMultipleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var propertyInjectedClassMultiple = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class PropertyInjectedClassSingleTests
11 | {
12 | [TestMethod]
13 | public void TestMethod1()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var propertyInjectedClassSingle = mocker.Create();
18 |
19 | // Act
20 |
21 |
22 | // Assert
23 | Assert.Fail();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_SomeService.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using System;
5 | using UnitBoilerplate.Sandbox.Classes;
6 | using UnitBoilerplate.Sandbox.Classes.Cases;
7 |
8 | namespace UnitTestBoilerplate.SelfTest.Cases
9 | {
10 | [TestClass]
11 | public class SomeServiceTests
12 | {
13 | [TestMethod]
14 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
15 | {
16 | // Arrange
17 | var mocker = new AutoMoqer();
18 | var service = mocker.Create();
19 | int a = 0;
20 | int b = 0;
21 |
22 | // Act
23 | var result = service.AddNumbers(
24 | a,
25 | b);
26 |
27 | // Assert
28 | Assert.Fail();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_AutoMoq_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using System;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeStructTests
11 | {
12 | [TestMethod]
13 | public void GetValue_StateUnderTest_ExpectedBehavior()
14 | {
15 | // Arrange
16 | var mocker = new AutoMoqer();
17 | var someStruct = mocker.Create();
18 | int c = 0;
19 |
20 | // Act
21 | var result = someStruct.GetValue(
22 | c);
23 |
24 | // Assert
25 | Assert.Fail();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private SomeClass fakeSomeClass;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.fakeSomeClass = A.Fake();
17 | }
18 |
19 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
20 | {
21 | return new ClassWithNonInterfaceCtorParam(
22 | this.fakeSomeClass);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
19 | {
20 | return new ClassWithOddCtorParams(
21 | TODO,
22 | TODO);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private ISomeInterface fakeSomeInterface;
12 | private ISomeOtherInterface fakeSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.fakeSomeInterface = A.Fake();
18 | this.fakeSomeOtherInterface = A.Fake();
19 | }
20 |
21 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
22 | {
23 | return new ConstructorInjectedClassMultiple(
24 | this.fakeSomeInterface,
25 | this.fakeSomeOtherInterface);
26 | }
27 |
28 | [TestMethod]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private ISomeInterface fakeSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.fakeSomeInterface = A.Fake();
17 | }
18 |
19 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
20 | {
21 | return new ConstructorInjectedClassSingle(
22 | this.fakeSomeInterface);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class DerivedPropertyInjectedClassTests
10 | {
11 | private IInterface3 fakeInterface3;
12 | private ISomeInterface fakeSomeInterface;
13 | private ISomeOtherInterface fakeSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.fakeInterface3 = A.Fake();
19 | this.fakeSomeInterface = A.Fake();
20 | this.fakeSomeOtherInterface = A.Fake();
21 | }
22 |
23 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
24 | {
25 | return new DerivedPropertyInjectedClass
26 | {
27 | Interface3Property = this.fakeInterface3,
28 | MyProperty = this.fakeSomeInterface,
29 | Property2 = this.fakeSomeOtherInterface,
30 | };
31 | }
32 |
33 | [TestMethod]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassMultipleTests
10 | {
11 | private IInterface3 fakeInterface3;
12 | private IInterface4 fakeInterface4;
13 | private ISomeInterface fakeSomeInterface;
14 | private ISomeOtherInterface fakeSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.fakeInterface3 = A.Fake();
20 | this.fakeInterface4 = A.Fake();
21 | this.fakeSomeInterface = A.Fake();
22 | this.fakeSomeOtherInterface = A.Fake();
23 | }
24 |
25 | private MixedInjectedClassMultiple CreateMixedInjectedClassMultiple()
26 | {
27 | return new MixedInjectedClassMultiple(
28 | this.fakeSomeInterface,
29 | this.fakeSomeOtherInterface)
30 | {
31 | Interface3Property = this.fakeInterface3,
32 | Interface4Property = this.fakeInterface4,
33 | };
34 | }
35 |
36 | [TestMethod]
37 | public void TestMethod1()
38 | {
39 | // Arrange
40 | var mixedInjectedClassMultiple = this.CreateMixedInjectedClassMultiple();
41 |
42 | // Act
43 |
44 |
45 | // Assert
46 | Assert.Fail();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private IInterface3 fakeInterface3;
12 | private ISomeInterface fakeSomeInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.fakeInterface3 = A.Fake();
18 | this.fakeSomeInterface = A.Fake();
19 | }
20 |
21 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
22 | {
23 | return new MixedInjectedClassSingle(
24 | this.fakeSomeInterface)
25 | {
26 | Interface3Property = this.fakeInterface3,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClass CreateNotInjectedClass()
19 | {
20 | return new NotInjectedClass();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClass = this.CreateNotInjectedClass();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
19 | {
20 | return new NotInjectedClassEmptyCtor();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private ISomeInterface fakeSomeInterface;
12 | private ISomeOtherInterface fakeSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.fakeSomeInterface = A.Fake();
18 | this.fakeSomeOtherInterface = A.Fake();
19 | }
20 |
21 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
22 | {
23 | return new PropertyInjectedClassMultiple
24 | {
25 | MyProperty = this.fakeSomeInterface,
26 | Property2 = this.fakeSomeOtherInterface,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private ISomeInterface fakeSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.fakeSomeInterface = A.Fake();
17 | }
18 |
19 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
20 | {
21 | return new PropertyInjectedClassSingle
22 | {
23 | MyProperty = this.fakeSomeInterface,
24 | };
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_SomeService.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeServiceTests
11 | {
12 | private ISomeInterface fakeSomeInterface;
13 | private ISomeOtherInterface fakeSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.fakeSomeInterface = A.Fake();
19 | this.fakeSomeOtherInterface = A.Fake();
20 | }
21 |
22 | private SomeService CreateService()
23 | {
24 | return new SomeService(
25 | this.fakeSomeInterface,
26 | this.fakeSomeOtherInterface);
27 | }
28 |
29 | [TestMethod]
30 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
31 | {
32 | // Arrange
33 | var service = this.CreateService();
34 | int a = 0;
35 | int b = 0;
36 |
37 | // Act
38 | var result = service.AddNumbers(
39 | a,
40 | b);
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_FakeItEasy_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using FakeItEasy;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeStructTests
10 | {
11 |
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 |
17 | }
18 |
19 | private SomeStruct CreateSomeStruct()
20 | {
21 | return new SomeStruct(
22 | TODO,
23 | TODO);
24 | }
25 |
26 | [TestMethod]
27 | public void GetValue_StateUnderTest_ExpectedBehavior()
28 | {
29 | // Arrange
30 | var someStruct = this.CreateSomeStruct();
31 | int c = 0;
32 |
33 | // Act
34 | var result = someStruct.GetValue(
35 | c);
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private SomeClass mockSomeClass;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.mockSomeClass = Mock.Create();
17 | }
18 |
19 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
20 | {
21 | return new ClassWithNonInterfaceCtorParam(
22 | this.mockSomeClass);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
19 | {
20 | return new ClassWithOddCtorParams(
21 | TODO,
22 | TODO);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private ISomeInterface mockSomeInterface;
12 | private ISomeOtherInterface mockSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockSomeInterface = Mock.Create();
18 | this.mockSomeOtherInterface = Mock.Create();
19 | }
20 |
21 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
22 | {
23 | return new ConstructorInjectedClassMultiple(
24 | this.mockSomeInterface,
25 | this.mockSomeOtherInterface);
26 | }
27 |
28 | [TestMethod]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private ISomeInterface mockSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.mockSomeInterface = Mock.Create();
17 | }
18 |
19 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
20 | {
21 | return new ConstructorInjectedClassSingle(
22 | this.mockSomeInterface);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class DerivedPropertyInjectedClassTests
10 | {
11 | private IInterface3 mockInterface3;
12 | private ISomeInterface mockSomeInterface;
13 | private ISomeOtherInterface mockSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockInterface3 = Mock.Create();
19 | this.mockSomeInterface = Mock.Create();
20 | this.mockSomeOtherInterface = Mock.Create();
21 | }
22 |
23 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
24 | {
25 | return new DerivedPropertyInjectedClass
26 | {
27 | Interface3Property = this.mockInterface3,
28 | MyProperty = this.mockSomeInterface,
29 | Property2 = this.mockSomeOtherInterface,
30 | };
31 | }
32 |
33 | [TestMethod]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassMultipleTests
10 | {
11 | private IInterface3 mockInterface3;
12 | private IInterface4 mockInterface4;
13 | private ISomeInterface mockSomeInterface;
14 | private ISomeOtherInterface mockSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.mockInterface3 = Mock.Create();
20 | this.mockInterface4 = Mock.Create();
21 | this.mockSomeInterface = Mock.Create();
22 | this.mockSomeOtherInterface = Mock.Create();
23 | }
24 |
25 | private MixedInjectedClassMultiple CreateMixedInjectedClassMultiple()
26 | {
27 | return new MixedInjectedClassMultiple(
28 | this.mockSomeInterface,
29 | this.mockSomeOtherInterface)
30 | {
31 | Interface3Property = this.mockInterface3,
32 | Interface4Property = this.mockInterface4,
33 | };
34 | }
35 |
36 | [TestMethod]
37 | public void TestMethod1()
38 | {
39 | // Arrange
40 | var mixedInjectedClassMultiple = this.CreateMixedInjectedClassMultiple();
41 |
42 | // Act
43 |
44 |
45 | // Assert
46 | Assert.Fail();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private IInterface3 mockInterface3;
12 | private ISomeInterface mockSomeInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockInterface3 = Mock.Create();
18 | this.mockSomeInterface = Mock.Create();
19 | }
20 |
21 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
22 | {
23 | return new MixedInjectedClassSingle(
24 | this.mockSomeInterface)
25 | {
26 | Interface3Property = this.mockInterface3,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClass CreateNotInjectedClass()
19 | {
20 | return new NotInjectedClass();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClass = this.CreateNotInjectedClass();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
19 | {
20 | return new NotInjectedClassEmptyCtor();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private ISomeInterface mockSomeInterface;
12 | private ISomeOtherInterface mockSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockSomeInterface = Mock.Create();
18 | this.mockSomeOtherInterface = Mock.Create();
19 | }
20 |
21 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
22 | {
23 | return new PropertyInjectedClassMultiple
24 | {
25 | MyProperty = this.mockSomeInterface,
26 | Property2 = this.mockSomeOtherInterface,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Telerik.JustMock;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private ISomeInterface mockSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.mockSomeInterface = Mock.Create();
17 | }
18 |
19 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
20 | {
21 | return new PropertyInjectedClassSingle
22 | {
23 | MyProperty = this.mockSomeInterface,
24 | };
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using Telerik.JustMock;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeServiceTests
11 | {
12 | private ISomeInterface mockSomeInterface;
13 | private ISomeOtherInterface mockSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockSomeInterface = Mock.Create();
19 | this.mockSomeOtherInterface = Mock.Create();
20 | }
21 |
22 | private SomeService CreateService()
23 | {
24 | return new SomeService(
25 | this.mockSomeInterface,
26 | this.mockSomeOtherInterface);
27 | }
28 |
29 | [TestMethod]
30 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
31 | {
32 | // Arrange
33 | var service = this.CreateService();
34 | int a = 0;
35 | int b = 0;
36 |
37 | // Act
38 | var result = service.AddNumbers(
39 | a,
40 | b);
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_JustMock_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using Telerik.JustMock;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeStructTests
10 | {
11 |
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 |
17 | }
18 |
19 | private SomeStruct CreateSomeStruct()
20 | {
21 | return new SomeStruct(
22 | TODO,
23 | TODO);
24 | }
25 |
26 | [TestMethod]
27 | public void GetValue_StateUnderTest_ExpectedBehavior()
28 | {
29 | // Arrange
30 | var someStruct = this.CreateSomeStruct();
31 | int c = 0;
32 |
33 | // Act
34 | var result = someStruct.GetValue(
35 | c);
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeClass;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeClass = this.mockRepository.Create();
21 | }
22 |
23 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
24 | {
25 | return new ClassWithNonInterfaceCtorParam(
26 | this.mockSomeClass.Object);
27 | }
28 |
29 | [TestMethod]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
23 | {
24 | return new ClassWithOddCtorParams(
25 | TODO,
26 | TODO);
27 | }
28 |
29 | [TestMethod]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | this.mockSomeOtherInterface = this.mockRepository.Create();
23 | }
24 |
25 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
26 | {
27 | return new ConstructorInjectedClassMultiple(
28 | this.mockSomeInterface.Object,
29 | this.mockSomeOtherInterface.Object);
30 | }
31 |
32 | [TestMethod]
33 | public void TestMethod1()
34 | {
35 | // Arrange
36 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
37 |
38 | // Act
39 |
40 |
41 | // Assert
42 | Assert.Fail();
43 | this.mockRepository.VerifyAll();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | }
22 |
23 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
24 | {
25 | return new ConstructorInjectedClassSingle(
26 | this.mockSomeInterface.Object);
27 | }
28 |
29 | [TestMethod]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | this.mockRepository.VerifyAll();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockInterface3;
14 | private Mock mockSomeInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockInterface3 = this.mockRepository.Create();
22 | this.mockSomeInterface = this.mockRepository.Create();
23 | }
24 |
25 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
26 | {
27 | return new MixedInjectedClassSingle(
28 | this.mockSomeInterface.Object)
29 | {
30 | Interface3Property = this.mockInterface3.Object,
31 | };
32 | }
33 |
34 | [TestMethod]
35 | public void TestMethod1()
36 | {
37 | // Arrange
38 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
39 |
40 | // Act
41 |
42 |
43 | // Assert
44 | Assert.Fail();
45 | this.mockRepository.VerifyAll();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private NotInjectedClass CreateNotInjectedClass()
23 | {
24 | return new NotInjectedClass();
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var notInjectedClass = this.CreateNotInjectedClass();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | this.mockRepository.VerifyAll();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 |
20 | }
21 |
22 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
23 | {
24 | return new NotInjectedClassEmptyCtor();
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | this.mockRepository.VerifyAll();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.mockRepository = new MockRepository(MockBehavior.Strict);
20 |
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | this.mockSomeOtherInterface = this.mockRepository.Create();
23 | }
24 |
25 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
26 | {
27 | return new PropertyInjectedClassMultiple
28 | {
29 | MyProperty = this.mockSomeInterface.Object,
30 | Property2 = this.mockSomeOtherInterface.Object,
31 | };
32 | }
33 |
34 | [TestMethod]
35 | public void TestMethod1()
36 | {
37 | // Arrange
38 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
39 |
40 | // Act
41 |
42 |
43 | // Assert
44 | Assert.Fail();
45 | this.mockRepository.VerifyAll();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | }
22 |
23 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
24 | {
25 | return new PropertyInjectedClassSingle
26 | {
27 | MyProperty = this.mockSomeInterface.Object,
28 | };
29 | }
30 |
31 | [TestMethod]
32 | public void TestMethod1()
33 | {
34 | // Arrange
35 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
36 |
37 | // Act
38 |
39 |
40 | // Assert
41 | Assert.Fail();
42 | this.mockRepository.VerifyAll();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeServiceTests
11 | {
12 | private MockRepository mockRepository;
13 |
14 | private Mock mockSomeInterface;
15 | private Mock mockSomeOtherInterface;
16 |
17 | [TestInitialize]
18 | public void TestInitialize()
19 | {
20 | this.mockRepository = new MockRepository(MockBehavior.Strict);
21 |
22 | this.mockSomeInterface = this.mockRepository.Create();
23 | this.mockSomeOtherInterface = this.mockRepository.Create();
24 | }
25 |
26 | private SomeService CreateService()
27 | {
28 | return new SomeService(
29 | this.mockSomeInterface.Object,
30 | this.mockSomeOtherInterface.Object);
31 | }
32 |
33 | [TestMethod]
34 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
35 | {
36 | // Arrange
37 | var service = this.CreateService();
38 | int a = 0;
39 | int b = 0;
40 |
41 | // Act
42 | var result = service.AddNumbers(
43 | a,
44 | b);
45 |
46 | // Assert
47 | Assert.Fail();
48 | this.mockRepository.VerifyAll();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Moq_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Moq;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeStructTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 |
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 |
21 | }
22 |
23 | private SomeStruct CreateSomeStruct()
24 | {
25 | return new SomeStruct(
26 | TODO,
27 | TODO);
28 | }
29 |
30 | [TestMethod]
31 | public void GetValue_StateUnderTest_ExpectedBehavior()
32 | {
33 | // Arrange
34 | var someStruct = this.CreateSomeStruct();
35 | int c = 0;
36 |
37 | // Act
38 | var result = someStruct.GetValue(
39 | c);
40 |
41 | // Assert
42 | Assert.Fail();
43 | this.mockRepository.VerifyAll();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private SomeClass subSomeClass;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.subSomeClass = Substitute.For();
17 | }
18 |
19 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
20 | {
21 | return new ClassWithNonInterfaceCtorParam(
22 | this.subSomeClass);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
19 | {
20 | return new ClassWithOddCtorParams(
21 | TODO,
22 | TODO);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private ISomeInterface subSomeInterface;
12 | private ISomeOtherInterface subSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.subSomeInterface = Substitute.For();
18 | this.subSomeOtherInterface = Substitute.For();
19 | }
20 |
21 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
22 | {
23 | return new ConstructorInjectedClassMultiple(
24 | this.subSomeInterface,
25 | this.subSomeOtherInterface);
26 | }
27 |
28 | [TestMethod]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private ISomeInterface subSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.subSomeInterface = Substitute.For();
17 | }
18 |
19 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
20 | {
21 | return new ConstructorInjectedClassSingle(
22 | this.subSomeInterface);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class DerivedPropertyInjectedClassTests
10 | {
11 | private IInterface3 subInterface3;
12 | private ISomeInterface subSomeInterface;
13 | private ISomeOtherInterface subSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.subInterface3 = Substitute.For();
19 | this.subSomeInterface = Substitute.For();
20 | this.subSomeOtherInterface = Substitute.For();
21 | }
22 |
23 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
24 | {
25 | return new DerivedPropertyInjectedClass
26 | {
27 | Interface3Property = this.subInterface3,
28 | MyProperty = this.subSomeInterface,
29 | Property2 = this.subSomeOtherInterface,
30 | };
31 | }
32 |
33 | [TestMethod]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassMultipleTests
10 | {
11 | private IInterface3 subInterface3;
12 | private IInterface4 subInterface4;
13 | private ISomeInterface subSomeInterface;
14 | private ISomeOtherInterface subSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.subInterface3 = Substitute.For();
20 | this.subInterface4 = Substitute.For();
21 | this.subSomeInterface = Substitute.For();
22 | this.subSomeOtherInterface = Substitute.For();
23 | }
24 |
25 | private MixedInjectedClassMultiple CreateMixedInjectedClassMultiple()
26 | {
27 | return new MixedInjectedClassMultiple(
28 | this.subSomeInterface,
29 | this.subSomeOtherInterface)
30 | {
31 | Interface3Property = this.subInterface3,
32 | Interface4Property = this.subInterface4,
33 | };
34 | }
35 |
36 | [TestMethod]
37 | public void TestMethod1()
38 | {
39 | // Arrange
40 | var mixedInjectedClassMultiple = this.CreateMixedInjectedClassMultiple();
41 |
42 | // Act
43 |
44 |
45 | // Assert
46 | Assert.Fail();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private IInterface3 subInterface3;
12 | private ISomeInterface subSomeInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.subInterface3 = Substitute.For();
18 | this.subSomeInterface = Substitute.For();
19 | }
20 |
21 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
22 | {
23 | return new MixedInjectedClassSingle(
24 | this.subSomeInterface)
25 | {
26 | Interface3Property = this.subInterface3,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClass CreateNotInjectedClass()
19 | {
20 | return new NotInjectedClass();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClass = this.CreateNotInjectedClass();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
19 | {
20 | return new NotInjectedClassEmptyCtor();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private ISomeInterface subSomeInterface;
12 | private ISomeOtherInterface subSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.subSomeInterface = Substitute.For();
18 | this.subSomeOtherInterface = Substitute.For();
19 | }
20 |
21 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
22 | {
23 | return new PropertyInjectedClassMultiple
24 | {
25 | MyProperty = this.subSomeInterface,
26 | Property2 = this.subSomeOtherInterface,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private ISomeInterface subSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.subSomeInterface = Substitute.For();
17 | }
18 |
19 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
20 | {
21 | return new PropertyInjectedClassSingle
22 | {
23 | MyProperty = this.subSomeInterface,
24 | };
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeServiceTests
11 | {
12 | private ISomeInterface subSomeInterface;
13 | private ISomeOtherInterface subSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.subSomeInterface = Substitute.For();
19 | this.subSomeOtherInterface = Substitute.For();
20 | }
21 |
22 | private SomeService CreateService()
23 | {
24 | return new SomeService(
25 | this.subSomeInterface,
26 | this.subSomeOtherInterface);
27 | }
28 |
29 | [TestMethod]
30 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
31 | {
32 | // Arrange
33 | var service = this.CreateService();
34 | int a = 0;
35 | int b = 0;
36 |
37 | // Act
38 | var result = service.AddNumbers(
39 | a,
40 | b);
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_NSubstitute_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using NSubstitute;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeStructTests
10 | {
11 |
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 |
17 | }
18 |
19 | private SomeStruct CreateSomeStruct()
20 | {
21 | return new SomeStruct(
22 | TODO,
23 | TODO);
24 | }
25 |
26 | [TestMethod]
27 | public void GetValue_StateUnderTest_ExpectedBehavior()
28 | {
29 | // Arrange
30 | var someStruct = this.CreateSomeStruct();
31 | int c = 0;
32 |
33 | // Act
34 | var result = someStruct.GetValue(
35 | c);
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System.Collections.Generic;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithGenericInterfaceTests
10 | {
11 | [TestMethod]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var classWithGenericInterface = new ClassWithGenericInterface(TODO, TODO, TODO);
16 |
17 | // Act
18 |
19 |
20 | // Assert
21 | Assert.Fail();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithNonInterfaceCtorParamTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var classWithNonInterfaceCtorParam = new ClassWithNonInterfaceCtorParam(TODO);
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class ClassWithOddCtorParamsTests
8 | {
9 | [TestMethod]
10 | public void TestMethod1()
11 | {
12 | // Arrange
13 | var classWithOddCtorParams = new ClassWithOddCtorParams(TODO, TODO);
14 |
15 | // Act
16 |
17 |
18 | // Assert
19 | Assert.Fail();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ConstructorInjectedClassMultipleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var constructorInjectedClassMultiple = new ConstructorInjectedClassMultiple(TODO, TODO);
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ConstructorInjectedClassSingleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var constructorInjectedClassSingle = new ConstructorInjectedClassSingle(TODO);
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class DerivedPropertyInjectedClassTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var derivedPropertyInjectedClass = new DerivedPropertyInjectedClass();
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class MixedInjectedClassMultipleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var mixedInjectedClassMultiple = new MixedInjectedClassMultiple(TODO, TODO);
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class MixedInjectedClassSingleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var mixedInjectedClassSingle = new MixedInjectedClassSingle(TODO);
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class NotInjectedClassTests
8 | {
9 | [TestMethod]
10 | public void TestMethod1()
11 | {
12 | // Arrange
13 | var notInjectedClass = new NotInjectedClass();
14 |
15 | // Act
16 |
17 |
18 | // Assert
19 | Assert.Fail();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class NotInjectedClassEmptyCtorTests
8 | {
9 | [TestMethod]
10 | public void TestMethod1()
11 | {
12 | // Arrange
13 | var notInjectedClassEmptyCtor = new NotInjectedClassEmptyCtor();
14 |
15 | // Act
16 |
17 |
18 | // Assert
19 | Assert.Fail();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class PropertyInjectedClassMultipleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var propertyInjectedClassMultiple = new PropertyInjectedClassMultiple();
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class PropertyInjectedClassSingleTests
9 | {
10 | [TestMethod]
11 | public void TestMethod1()
12 | {
13 | // Arrange
14 | var propertyInjectedClassSingle = new PropertyInjectedClassSingle();
15 |
16 | // Act
17 |
18 |
19 | // Assert
20 | Assert.Fail();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeServiceTests
10 | {
11 | [TestMethod]
12 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
13 | {
14 | // Arrange
15 | var service = new SomeService(TODO, TODO);
16 | int a = 0;
17 | int b = 0;
18 |
19 | // Act
20 | var result = service.AddNumbers(
21 | a,
22 | b);
23 |
24 | // Assert
25 | Assert.Fail();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_None_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class SomeStructTests
9 | {
10 | [TestMethod]
11 | public void GetValue_StateUnderTest_ExpectedBehavior()
12 | {
13 | // Arrange
14 | var someStruct = new SomeStruct(TODO, TODO);
15 | int c = 0;
16 |
17 | // Act
18 | var result = someStruct.GetValue(
19 | c);
20 |
21 | // Assert
22 | Assert.Fail();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private SomeClass stubSomeClass;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubSomeClass = MockRepository.GenerateStub();
17 | }
18 |
19 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
20 | {
21 | return new ClassWithNonInterfaceCtorParam(
22 | this.stubSomeClass);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithOddCtorParamsTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
19 | {
20 | return new ClassWithOddCtorParams(
21 | TODO,
22 | TODO);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private ISomeInterface stubSomeInterface;
12 | private ISomeOtherInterface stubSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.stubSomeInterface = MockRepository.GenerateStub();
18 | this.stubSomeOtherInterface = MockRepository.GenerateStub();
19 | }
20 |
21 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
22 | {
23 | return new ConstructorInjectedClassMultiple(
24 | this.stubSomeInterface,
25 | this.stubSomeOtherInterface);
26 | }
27 |
28 | [TestMethod]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private ISomeInterface stubSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubSomeInterface = MockRepository.GenerateStub();
17 | }
18 |
19 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
20 | {
21 | return new ConstructorInjectedClassSingle(
22 | this.stubSomeInterface);
23 | }
24 |
25 | [TestMethod]
26 | public void TestMethod1()
27 | {
28 | // Arrange
29 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
30 |
31 | // Act
32 |
33 |
34 | // Assert
35 | Assert.Fail();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class DerivedPropertyInjectedClassTests
10 | {
11 | private IInterface3 stubInterface3;
12 | private ISomeInterface stubSomeInterface;
13 | private ISomeOtherInterface stubSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.stubInterface3 = MockRepository.GenerateStub();
19 | this.stubSomeInterface = MockRepository.GenerateStub();
20 | this.stubSomeOtherInterface = MockRepository.GenerateStub();
21 | }
22 |
23 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
24 | {
25 | return new DerivedPropertyInjectedClass
26 | {
27 | Interface3Property = this.stubInterface3,
28 | MyProperty = this.stubSomeInterface,
29 | Property2 = this.stubSomeOtherInterface,
30 | };
31 | }
32 |
33 | [TestMethod]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassMultipleTests
10 | {
11 | private IInterface3 stubInterface3;
12 | private IInterface4 stubInterface4;
13 | private ISomeInterface stubSomeInterface;
14 | private ISomeOtherInterface stubSomeOtherInterface;
15 |
16 | [TestInitialize]
17 | public void TestInitialize()
18 | {
19 | this.stubInterface3 = MockRepository.GenerateStub();
20 | this.stubInterface4 = MockRepository.GenerateStub();
21 | this.stubSomeInterface = MockRepository.GenerateStub();
22 | this.stubSomeOtherInterface = MockRepository.GenerateStub();
23 | }
24 |
25 | private MixedInjectedClassMultiple CreateMixedInjectedClassMultiple()
26 | {
27 | return new MixedInjectedClassMultiple(
28 | this.stubSomeInterface,
29 | this.stubSomeOtherInterface)
30 | {
31 | Interface3Property = this.stubInterface3,
32 | Interface4Property = this.stubInterface4,
33 | };
34 | }
35 |
36 | [TestMethod]
37 | public void TestMethod1()
38 | {
39 | // Arrange
40 | var mixedInjectedClassMultiple = this.CreateMixedInjectedClassMultiple();
41 |
42 | // Act
43 |
44 |
45 | // Assert
46 | Assert.Fail();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private IInterface3 stubInterface3;
12 | private ISomeInterface stubSomeInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.stubInterface3 = MockRepository.GenerateStub();
18 | this.stubSomeInterface = MockRepository.GenerateStub();
19 | }
20 |
21 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
22 | {
23 | return new MixedInjectedClassSingle(
24 | this.stubSomeInterface)
25 | {
26 | Interface3Property = this.stubInterface3,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClass CreateNotInjectedClass()
19 | {
20 | return new NotInjectedClass();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClass = this.CreateNotInjectedClass();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
19 | {
20 | return new NotInjectedClassEmptyCtor();
21 | }
22 |
23 | [TestMethod]
24 | public void TestMethod1()
25 | {
26 | // Arrange
27 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
28 |
29 | // Act
30 |
31 |
32 | // Assert
33 | Assert.Fail();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private ISomeInterface stubSomeInterface;
12 | private ISomeOtherInterface stubSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.stubSomeInterface = MockRepository.GenerateStub();
18 | this.stubSomeOtherInterface = MockRepository.GenerateStub();
19 | }
20 |
21 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
22 | {
23 | return new PropertyInjectedClassMultiple
24 | {
25 | MyProperty = this.stubSomeInterface,
26 | Property2 = this.stubSomeOtherInterface,
27 | };
28 | }
29 |
30 | [TestMethod]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.Fail();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private ISomeInterface stubSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubSomeInterface = MockRepository.GenerateStub();
17 | }
18 |
19 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
20 | {
21 | return new PropertyInjectedClassSingle
22 | {
23 | MyProperty = this.stubSomeInterface,
24 | };
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes;
5 | using UnitBoilerplate.Sandbox.Classes.Cases;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | [TestClass]
10 | public class SomeServiceTests
11 | {
12 | private ISomeInterface stubSomeInterface;
13 | private ISomeOtherInterface stubSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.stubSomeInterface = MockRepository.GenerateStub();
19 | this.stubSomeOtherInterface = MockRepository.GenerateStub();
20 | }
21 |
22 | private SomeService CreateService()
23 | {
24 | return new SomeService(
25 | this.stubSomeInterface,
26 | this.stubSomeOtherInterface);
27 | }
28 |
29 | [TestMethod]
30 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
31 | {
32 | // Arrange
33 | var service = this.CreateService();
34 | int a = 0;
35 | int b = 0;
36 |
37 | // Act
38 | var result = service.AddNumbers(
39 | a,
40 | b);
41 |
42 | // Assert
43 | Assert.Fail();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_Rhino Mocks_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Rhino.Mocks;
3 | using System;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeStructTests
10 | {
11 |
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 |
17 | }
18 |
19 | private SomeStruct CreateSomeStruct()
20 | {
21 | return new SomeStruct(
22 | TODO,
23 | TODO);
24 | }
25 |
26 | [TestMethod]
27 | public void GetValue_StateUnderTest_ExpectedBehavior()
28 | {
29 | // Arrange
30 | var someStruct = this.CreateSomeStruct();
31 | int c = 0;
32 |
33 | // Act
34 | var result = someStruct.GetValue(
35 | c);
36 |
37 | // Assert
38 | Assert.Fail();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithGenericInterfaceTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubISomeInterface stubSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubInterface3 = new StubIInterface3();
17 | this.stubSomeInterface = new StubISomeInterface();
18 | }
19 |
20 | private ClassWithGenericInterface CreateClassWithGenericInterface()
21 | {
22 | return new ClassWithGenericInterface(
23 | TODO,
24 | TODO,
25 | this.stubSomeInterface)
26 | {
27 | Interface2 = this.stubInterface3,
28 | };
29 | }
30 |
31 | [TestMethod]
32 | public void TestMethod1()
33 | {
34 | // Arrange
35 | var classWithGenericInterface = this.CreateClassWithGenericInterface();
36 |
37 | // Act
38 |
39 |
40 | // Assert
41 | Assert.Fail();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ClassWithNonInterfaceCtorParamTests
9 | {
10 | private StubSomeClass stubSomeClass;
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 | this.stubSomeClass = new StubSomeClass();
16 | }
17 |
18 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
19 | {
20 | return new ClassWithNonInterfaceCtorParam(
21 | this.stubSomeClass);
22 | }
23 |
24 | [TestMethod]
25 | public void TestMethod1()
26 | {
27 | // Arrange
28 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
29 |
30 | // Act
31 |
32 |
33 | // Assert
34 | Assert.Fail();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class ClassWithOddCtorParamsTests
8 | {
9 |
10 |
11 | [TestInitialize]
12 | public void TestInitialize()
13 | {
14 |
15 | }
16 |
17 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
18 | {
19 | return new ClassWithOddCtorParams(
20 | TODO,
21 | TODO);
22 | }
23 |
24 | [TestMethod]
25 | public void TestMethod1()
26 | {
27 | // Arrange
28 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
29 |
30 | // Act
31 |
32 |
33 | // Assert
34 | Assert.Fail();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ConstructorInjectedClassMultipleTests
9 | {
10 | private StubISomeInterface stubSomeInterface;
11 | private StubISomeOtherInterface stubSomeOtherInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubSomeInterface = new StubISomeInterface();
17 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
18 | }
19 |
20 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
21 | {
22 | return new ConstructorInjectedClassMultiple(
23 | this.stubSomeInterface,
24 | this.stubSomeOtherInterface);
25 | }
26 |
27 | [TestMethod]
28 | public void TestMethod1()
29 | {
30 | // Arrange
31 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
32 |
33 | // Act
34 |
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class ConstructorInjectedClassSingleTests
9 | {
10 | private StubISomeInterface stubSomeInterface;
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 | this.stubSomeInterface = new StubISomeInterface();
16 | }
17 |
18 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
19 | {
20 | return new ConstructorInjectedClassSingle(
21 | this.stubSomeInterface);
22 | }
23 |
24 | [TestMethod]
25 | public void TestMethod1()
26 | {
27 | // Arrange
28 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
29 |
30 | // Act
31 |
32 |
33 | // Assert
34 | Assert.Fail();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_DerivedPropertyInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class DerivedPropertyInjectedClassTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubISomeInterface stubSomeInterface;
12 | private StubISomeOtherInterface stubSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.stubInterface3 = new StubIInterface3();
18 | this.stubSomeInterface = new StubISomeInterface();
19 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
20 | }
21 |
22 | private DerivedPropertyInjectedClass CreateDerivedPropertyInjectedClass()
23 | {
24 | return new DerivedPropertyInjectedClass
25 | {
26 | Interface3Property = this.stubInterface3,
27 | MyProperty = this.stubSomeInterface,
28 | Property2 = this.stubSomeOtherInterface,
29 | };
30 | }
31 |
32 | [TestMethod]
33 | public void TestMethod1()
34 | {
35 | // Arrange
36 | var derivedPropertyInjectedClass = this.CreateDerivedPropertyInjectedClass();
37 |
38 | // Act
39 |
40 |
41 | // Assert
42 | Assert.Fail();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_MixedInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class MixedInjectedClassMultipleTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubIInterface4 stubInterface4;
12 | private StubISomeInterface stubSomeInterface;
13 | private StubISomeOtherInterface stubSomeOtherInterface;
14 |
15 | [TestInitialize]
16 | public void TestInitialize()
17 | {
18 | this.stubInterface3 = new StubIInterface3();
19 | this.stubInterface4 = new StubIInterface4();
20 | this.stubSomeInterface = new StubISomeInterface();
21 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
22 | }
23 |
24 | private MixedInjectedClassMultiple CreateMixedInjectedClassMultiple()
25 | {
26 | return new MixedInjectedClassMultiple(
27 | this.stubSomeInterface,
28 | this.stubSomeOtherInterface)
29 | {
30 | Interface3Property = this.stubInterface3,
31 | Interface4Property = this.stubInterface4,
32 | };
33 | }
34 |
35 | [TestMethod]
36 | public void TestMethod1()
37 | {
38 | // Arrange
39 | var mixedInjectedClassMultiple = this.CreateMixedInjectedClassMultiple();
40 |
41 | // Act
42 |
43 |
44 | // Assert
45 | Assert.Fail();
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class MixedInjectedClassSingleTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubISomeInterface stubSomeInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubInterface3 = new StubIInterface3();
17 | this.stubSomeInterface = new StubISomeInterface();
18 | }
19 |
20 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
21 | {
22 | return new MixedInjectedClassSingle(
23 | this.stubSomeInterface)
24 | {
25 | Interface3Property = this.stubInterface3,
26 | };
27 | }
28 |
29 | [TestMethod]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class NotInjectedClassTests
8 | {
9 |
10 |
11 | [TestInitialize]
12 | public void TestInitialize()
13 | {
14 |
15 | }
16 |
17 | private NotInjectedClass CreateNotInjectedClass()
18 | {
19 | return new NotInjectedClass();
20 | }
21 |
22 | [TestMethod]
23 | public void TestMethod1()
24 | {
25 | // Arrange
26 | var notInjectedClass = this.CreateNotInjectedClass();
27 |
28 | // Act
29 |
30 |
31 | // Assert
32 | Assert.Fail();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes.Cases;
3 |
4 | namespace UnitTestBoilerplate.SelfTest.Cases
5 | {
6 | [TestClass]
7 | public class NotInjectedClassEmptyCtorTests
8 | {
9 |
10 |
11 | [TestInitialize]
12 | public void TestInitialize()
13 | {
14 |
15 | }
16 |
17 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
18 | {
19 | return new NotInjectedClassEmptyCtor();
20 | }
21 |
22 | [TestMethod]
23 | public void TestMethod1()
24 | {
25 | // Arrange
26 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
27 |
28 | // Act
29 |
30 |
31 | // Assert
32 | Assert.Fail();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class PropertyInjectedClassMultipleTests
9 | {
10 | private StubISomeInterface stubSomeInterface;
11 | private StubISomeOtherInterface stubSomeOtherInterface;
12 |
13 | [TestInitialize]
14 | public void TestInitialize()
15 | {
16 | this.stubSomeInterface = new StubISomeInterface();
17 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
18 | }
19 |
20 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
21 | {
22 | return new PropertyInjectedClassMultiple
23 | {
24 | MyProperty = this.stubSomeInterface,
25 | Property2 = this.stubSomeOtherInterface,
26 | };
27 | }
28 |
29 | [TestMethod]
30 | public void TestMethod1()
31 | {
32 | // Arrange
33 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
34 |
35 | // Act
36 |
37 |
38 | // Assert
39 | Assert.Fail();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class PropertyInjectedClassSingleTests
9 | {
10 | private StubISomeInterface stubSomeInterface;
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 | this.stubSomeInterface = new StubISomeInterface();
16 | }
17 |
18 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
19 | {
20 | return new PropertyInjectedClassSingle
21 | {
22 | MyProperty = this.stubSomeInterface,
23 | };
24 | }
25 |
26 | [TestMethod]
27 | public void TestMethod1()
28 | {
29 | // Arrange
30 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
31 |
32 | // Act
33 |
34 |
35 | // Assert
36 | Assert.Fail();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | [TestClass]
9 | public class SomeServiceTests
10 | {
11 | private StubISomeInterface stubSomeInterface;
12 | private StubISomeOtherInterface stubSomeOtherInterface;
13 |
14 | [TestInitialize]
15 | public void TestInitialize()
16 | {
17 | this.stubSomeInterface = new StubISomeInterface();
18 | this.stubSomeOtherInterface = new StubISomeOtherInterface();
19 | }
20 |
21 | private SomeService CreateService()
22 | {
23 | return new SomeService(
24 | this.stubSomeInterface,
25 | this.stubSomeOtherInterface);
26 | }
27 |
28 | [TestMethod]
29 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
30 | {
31 | // Arrange
32 | var service = this.CreateService();
33 | int a = 0;
34 | int b = 0;
35 |
36 | // Act
37 | var result = service.AddNumbers(
38 | a,
39 | b);
40 |
41 | // Assert
42 | Assert.Fail();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/VisualStudio_SimpleStubs_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 |
5 | namespace UnitTestBoilerplate.SelfTest.Cases
6 | {
7 | [TestClass]
8 | public class SomeStructTests
9 | {
10 |
11 |
12 | [TestInitialize]
13 | public void TestInitialize()
14 | {
15 |
16 | }
17 |
18 | private SomeStruct CreateSomeStruct()
19 | {
20 | return new SomeStruct(
21 | TODO,
22 | TODO);
23 | }
24 |
25 | [TestMethod]
26 | public void GetValue_StateUnderTest_ExpectedBehavior()
27 | {
28 | // Arrange
29 | var someStruct = this.CreateSomeStruct();
30 | int c = 0;
31 |
32 | // Act
33 | var result = someStruct.GetValue(
34 | c);
35 |
36 | // Assert
37 | Assert.Fail();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_AutoMoq_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using Moq;
3 | using System;
4 | using System.Collections.Generic;
5 | using UnitBoilerplate.Sandbox.Classes;
6 | using UnitBoilerplate.Sandbox.Classes.Cases;
7 | using Xunit;
8 |
9 | namespace UnitTestBoilerplate.SelfTest.Cases
10 | {
11 | public class ClassWithGenericInterfaceTests
12 | {
13 | [Fact]
14 | public void TestMethod1()
15 | {
16 | // Arrange
17 | var mocker = new AutoMoqer();
18 | var classWithGenericInterface = mocker.Create();
19 |
20 | // Act
21 |
22 |
23 | // Assert
24 | Assert.True(false);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_ClassWithNonInterfaceCtorParam.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class ClassWithNonInterfaceCtorParamTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeClass;
14 |
15 | public ClassWithNonInterfaceCtorParamTests()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 | this.mockSomeClass = this.mockRepository.Create();
20 | }
21 |
22 | private ClassWithNonInterfaceCtorParam CreateClassWithNonInterfaceCtorParam()
23 | {
24 | return new ClassWithNonInterfaceCtorParam(
25 | this.mockSomeClass.Object);
26 | }
27 |
28 | [Fact]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var classWithNonInterfaceCtorParam = this.CreateClassWithNonInterfaceCtorParam();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.True(false);
39 | this.mockRepository.VerifyAll();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_ClassWithOddCtorParams.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 | using Xunit;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | public class ClassWithOddCtorParamsTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | public ClassWithOddCtorParamsTests()
15 | {
16 | this.mockRepository = new MockRepository(MockBehavior.Strict);
17 |
18 |
19 | }
20 |
21 | private ClassWithOddCtorParams CreateClassWithOddCtorParams()
22 | {
23 | return new ClassWithOddCtorParams(
24 | TODO,
25 | TODO);
26 | }
27 |
28 | [Fact]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var classWithOddCtorParams = this.CreateClassWithOddCtorParams();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.True(false);
39 | this.mockRepository.VerifyAll();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_ConstructorInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class ConstructorInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | public ConstructorInjectedClassMultipleTests()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | this.mockSomeOtherInterface = this.mockRepository.Create();
22 | }
23 |
24 | private ConstructorInjectedClassMultiple CreateConstructorInjectedClassMultiple()
25 | {
26 | return new ConstructorInjectedClassMultiple(
27 | this.mockSomeInterface.Object,
28 | this.mockSomeOtherInterface.Object);
29 | }
30 |
31 | [Fact]
32 | public void TestMethod1()
33 | {
34 | // Arrange
35 | var constructorInjectedClassMultiple = this.CreateConstructorInjectedClassMultiple();
36 |
37 | // Act
38 |
39 |
40 | // Assert
41 | Assert.True(false);
42 | this.mockRepository.VerifyAll();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_ConstructorInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class ConstructorInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | public ConstructorInjectedClassSingleTests()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 | this.mockSomeInterface = this.mockRepository.Create();
20 | }
21 |
22 | private ConstructorInjectedClassSingle CreateConstructorInjectedClassSingle()
23 | {
24 | return new ConstructorInjectedClassSingle(
25 | this.mockSomeInterface.Object);
26 | }
27 |
28 | [Fact]
29 | public void TestMethod1()
30 | {
31 | // Arrange
32 | var constructorInjectedClassSingle = this.CreateConstructorInjectedClassSingle();
33 |
34 | // Act
35 |
36 |
37 | // Assert
38 | Assert.True(false);
39 | this.mockRepository.VerifyAll();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_MixedInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class MixedInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockInterface3;
14 | private Mock mockSomeInterface;
15 |
16 | public MixedInjectedClassSingleTests()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockInterface3 = this.mockRepository.Create();
21 | this.mockSomeInterface = this.mockRepository.Create();
22 | }
23 |
24 | private MixedInjectedClassSingle CreateMixedInjectedClassSingle()
25 | {
26 | return new MixedInjectedClassSingle(
27 | this.mockSomeInterface.Object)
28 | {
29 | Interface3Property = this.mockInterface3.Object,
30 | };
31 | }
32 |
33 | [Fact]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var mixedInjectedClassSingle = this.CreateMixedInjectedClassSingle();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.True(false);
44 | this.mockRepository.VerifyAll();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_NotInjectedClass.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 | using Xunit;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | public class NotInjectedClassTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | public NotInjectedClassTests()
15 | {
16 | this.mockRepository = new MockRepository(MockBehavior.Strict);
17 |
18 |
19 | }
20 |
21 | private NotInjectedClass CreateNotInjectedClass()
22 | {
23 | return new NotInjectedClass();
24 | }
25 |
26 | [Fact]
27 | public void TestMethod1()
28 | {
29 | // Arrange
30 | var notInjectedClass = this.CreateNotInjectedClass();
31 |
32 | // Act
33 |
34 |
35 | // Assert
36 | Assert.True(false);
37 | this.mockRepository.VerifyAll();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_NotInjectedClassEmptyCtor.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 | using Xunit;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | public class NotInjectedClassEmptyCtorTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | public NotInjectedClassEmptyCtorTests()
15 | {
16 | this.mockRepository = new MockRepository(MockBehavior.Strict);
17 |
18 |
19 | }
20 |
21 | private NotInjectedClassEmptyCtor CreateNotInjectedClassEmptyCtor()
22 | {
23 | return new NotInjectedClassEmptyCtor();
24 | }
25 |
26 | [Fact]
27 | public void TestMethod1()
28 | {
29 | // Arrange
30 | var notInjectedClassEmptyCtor = this.CreateNotInjectedClassEmptyCtor();
31 |
32 | // Act
33 |
34 |
35 | // Assert
36 | Assert.True(false);
37 | this.mockRepository.VerifyAll();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_PropertyInjectedClassMultiple.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class PropertyInjectedClassMultipleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | public PropertyInjectedClassMultipleTests()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | this.mockSomeOtherInterface = this.mockRepository.Create();
22 | }
23 |
24 | private PropertyInjectedClassMultiple CreatePropertyInjectedClassMultiple()
25 | {
26 | return new PropertyInjectedClassMultiple
27 | {
28 | MyProperty = this.mockSomeInterface.Object,
29 | Property2 = this.mockSomeOtherInterface.Object,
30 | };
31 | }
32 |
33 | [Fact]
34 | public void TestMethod1()
35 | {
36 | // Arrange
37 | var propertyInjectedClassMultiple = this.CreatePropertyInjectedClassMultiple();
38 |
39 | // Act
40 |
41 |
42 | // Assert
43 | Assert.True(false);
44 | this.mockRepository.VerifyAll();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_PropertyInjectedClassSingle.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class PropertyInjectedClassSingleTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 |
15 | public PropertyInjectedClassSingleTests()
16 | {
17 | this.mockRepository = new MockRepository(MockBehavior.Strict);
18 |
19 | this.mockSomeInterface = this.mockRepository.Create();
20 | }
21 |
22 | private PropertyInjectedClassSingle CreatePropertyInjectedClassSingle()
23 | {
24 | return new PropertyInjectedClassSingle
25 | {
26 | MyProperty = this.mockSomeInterface.Object,
27 | };
28 | }
29 |
30 | [Fact]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var propertyInjectedClassSingle = this.CreatePropertyInjectedClassSingle();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.True(false);
41 | this.mockRepository.VerifyAll();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_SomeService.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class SomeServiceTests
10 | {
11 | private MockRepository mockRepository;
12 |
13 | private Mock mockSomeInterface;
14 | private Mock mockSomeOtherInterface;
15 |
16 | public SomeServiceTests()
17 | {
18 | this.mockRepository = new MockRepository(MockBehavior.Strict);
19 |
20 | this.mockSomeInterface = this.mockRepository.Create();
21 | this.mockSomeOtherInterface = this.mockRepository.Create();
22 | }
23 |
24 | private SomeService CreateService()
25 | {
26 | return new SomeService(
27 | this.mockSomeInterface.Object,
28 | this.mockSomeOtherInterface.Object);
29 | }
30 |
31 | [Fact]
32 | public void AddNumbers_StateUnderTest_ExpectedBehavior()
33 | {
34 | // Arrange
35 | var service = this.CreateService();
36 | int a = 0;
37 | int b = 0;
38 |
39 | // Act
40 | var result = service.AddNumbers(
41 | a,
42 | b);
43 |
44 | // Assert
45 | Assert.True(false);
46 | this.mockRepository.VerifyAll();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_Moq_SomeStruct.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 | using Xunit;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | public class SomeStructTests
9 | {
10 | private MockRepository mockRepository;
11 |
12 |
13 |
14 | public SomeStructTests()
15 | {
16 | this.mockRepository = new MockRepository(MockBehavior.Strict);
17 |
18 |
19 | }
20 |
21 | private SomeStruct CreateSomeStruct()
22 | {
23 | return new SomeStruct(
24 | TODO,
25 | TODO);
26 | }
27 |
28 | [Fact]
29 | public void GetValue_StateUnderTest_ExpectedBehavior()
30 | {
31 | // Arrange
32 | var someStruct = this.CreateSomeStruct();
33 | int c = 0;
34 |
35 | // Act
36 | var result = someStruct.GetValue(
37 | c);
38 |
39 | // Assert
40 | Assert.True(false);
41 | this.mockRepository.VerifyAll();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_None_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using UnitBoilerplate.Sandbox.Classes;
4 | using UnitBoilerplate.Sandbox.Classes.Cases;
5 | using Xunit;
6 |
7 | namespace UnitTestBoilerplate.SelfTest.Cases
8 | {
9 | public class ClassWithGenericInterfaceTests
10 | {
11 | [Fact]
12 | public void TestMethod1()
13 | {
14 | // Arrange
15 | var classWithGenericInterface = new ClassWithGenericInterface(TODO, TODO, TODO);
16 |
17 | // Act
18 |
19 |
20 | // Assert
21 | Assert.True(false);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SelfTestFiles/Expected/xUnit_SimpleStubs_ClassWithGenericInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnitBoilerplate.Sandbox.Classes;
3 | using UnitBoilerplate.Sandbox.Classes.Cases;
4 | using Xunit;
5 |
6 | namespace UnitTestBoilerplate.SelfTest.Cases
7 | {
8 | public class ClassWithGenericInterfaceTests
9 | {
10 | private StubIInterface3 stubInterface3;
11 | private StubISomeInterface stubSomeInterface;
12 |
13 | public ClassWithGenericInterfaceTests()
14 | {
15 | this.stubInterface3 = new StubIInterface3();
16 | this.stubSomeInterface = new StubISomeInterface();
17 | }
18 |
19 | private ClassWithGenericInterface CreateClassWithGenericInterface()
20 | {
21 | return new ClassWithGenericInterface(
22 | TODO,
23 | TODO,
24 | this.stubSomeInterface)
25 | {
26 | Interface2 = this.stubInterface3,
27 | };
28 | }
29 |
30 | [Fact]
31 | public void TestMethod1()
32 | {
33 | // Arrange
34 | var classWithGenericInterface = this.CreateClassWithGenericInterface();
35 |
36 | // Act
37 |
38 |
39 | // Assert
40 | Assert.True(false);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2017
2 |
3 | install:
4 | - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex
5 |
6 | before_build:
7 | - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion
8 | #- ps: Vsix-TokenReplacement source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"'
9 |
10 | build_script:
11 | - nuget restore -Verbosity quiet
12 | - msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
13 |
14 | after_test:
15 | - ps: Vsix-PushArtifacts | Vsix-PublishToGallery
16 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.CodeAnalysis;
7 |
8 | namespace UnitTestBoilerplate
9 | {
10 | public static class Extensions
11 | {
12 | public static IEnumerable GetBaseTypesAndThis(this ITypeSymbol type)
13 | {
14 | var current = type;
15 | while (current != null)
16 | {
17 | yield return current;
18 | current = current.BaseType;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/src/Key.snk
--------------------------------------------------------------------------------
/src/Model/BoilerplateSettingsJson.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 UnitTestBoilerplate.Model
8 | {
9 | public class BoilerplateSettingsJson
10 | {
11 | public int Version { get; set; }
12 |
13 | public string PreferredTestFrameworkName { get; set; }
14 |
15 | public string PreferredMockFrameworkName { get; set; }
16 |
17 | public string FileNameTemplate { get; set; }
18 |
19 | public IDictionary CustomMocks { get; set; }
20 |
21 | public string CustomMockFieldDeclarationTemplate { get; set; }
22 |
23 | public string CustomMockFieldInitializationTemplate { get; set; }
24 |
25 | public string CustomMockObjectReferenceTemplate { get; set; }
26 |
27 | public IDictionary Templates { get; set; } = new Dictionary();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Model/ComboChoice.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public class ComboChoice
4 | {
5 | public ComboChoice(T value, string display)
6 | {
7 | this.Value = value;
8 | this.Display = display;
9 | }
10 |
11 | public T Value { get; set; }
12 | public string Display { get; set; }
13 |
14 | public override string ToString()
15 | {
16 | return this.Display;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Model/ISettingsPageViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnitTestBoilerplate.Services;
7 |
8 | namespace UnitTestBoilerplate.Model
9 | {
10 | public interface ISettingsPageViewModel
11 | {
12 | void Refresh();
13 |
14 | void SaveCurrentSettings();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Model/InjectableProperty.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public class InjectableProperty : InjectableType
4 | {
5 | private InjectableProperty(string propertyName, string fullTypeString) : base(fullTypeString)
6 | {
7 | this.PropertyName = propertyName;
8 | }
9 |
10 | public string PropertyName { get; }
11 |
12 | public static InjectableProperty TryCreateInjectableProperty(string propertyName, string fullTypeString, MockFramework mockFramework)
13 | {
14 | if (!mockFramework.SupportsGenerics && fullTypeString.Contains("<"))
15 | {
16 | return null;
17 | }
18 |
19 | return new InjectableProperty(propertyName, fullTypeString);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Model/MethodArgumentDescriptor.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public class MethodArgumentDescriptor
4 | {
5 | public MethodArgumentDescriptor(TypeDescriptor typeInformation, string argumentName, ParameterModifier modifier)
6 | {
7 | TypeInformation = typeInformation;
8 | ArgumentName = argumentName;
9 | Modifier = modifier;
10 | }
11 |
12 | public TypeDescriptor TypeInformation { get; }
13 |
14 | public string ArgumentName { get; }
15 |
16 | public ParameterModifier Modifier { get; }
17 | }
18 |
19 | public enum ParameterModifier
20 | {
21 | None,
22 |
23 | Out,
24 |
25 | Ref
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Model/MethodDescriptor.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public class MethodDescriptor
4 | {
5 | public MethodDescriptor(string name, MethodArgumentDescriptor[] methodParameters, bool isAsync, bool hasReturnType)
6 | {
7 | Name = name;
8 | MethodParameters = methodParameters;
9 | IsAsync = isAsync;
10 | HasReturnType = hasReturnType;
11 | }
12 |
13 | public string Name { get; }
14 |
15 | public MethodArgumentDescriptor[] MethodParameters { get; }
16 |
17 | public bool IsAsync { get; }
18 |
19 | public bool HasReturnType { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Model/MockField.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public class MockField
4 | {
5 | public MockField(string name, string typeName)
6 | {
7 | this.Name = name;
8 | this.TypeName = typeName;
9 | }
10 |
11 | public string Name { get; }
12 |
13 | public string TypeName { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Model/ProjectItemSummary.cs:
--------------------------------------------------------------------------------
1 | using EnvDTE;
2 |
3 | namespace UnitTestBoilerplate.Model
4 | {
5 | public class ProjectItemSummary
6 | {
7 | public ProjectItemSummary(string filePath, string projectFilePath)
8 | {
9 | this.FilePath = filePath;
10 | this.ProjectFilePath = projectFilePath;
11 | }
12 |
13 | public ProjectItemSummary(ProjectItem projectItem)
14 | {
15 | this.FilePath = projectItem.FileNames[1];
16 | this.ProjectFilePath = projectItem.ContainingProject.FullName;
17 | }
18 |
19 | public string FilePath { get; }
20 |
21 | public string ProjectFilePath { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Model/SelfTestDetectionResult.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestDetectionResult
10 | {
11 | public SelfTestDetectionResult(string testFramework, string mockFramework)
12 | {
13 | this.TestFramework = testFramework;
14 | this.MockFramework = mockFramework;
15 | }
16 |
17 | public string TestFramework { get; set; }
18 |
19 | public string MockFramework { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Model/SelfTestDetectionTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnitTestBoilerplate.Services;
7 |
8 | namespace UnitTestBoilerplate.Model
9 | {
10 | public class SelfTestDetectionTest
11 | {
12 | public string ProjectName { get; }
13 |
14 | public IBoilerplateSettings Settings { get; }
15 |
16 | public string ExpectedTestFramework { get; }
17 |
18 | public string ExpectedMockFramework { get; }
19 |
20 | public SelfTestDetectionTest(string projectName, IBoilerplateSettings settings, string expectedTestFramework, string expectedMockFramework)
21 | {
22 | this.ProjectName = projectName;
23 | this.Settings = settings;
24 | this.ExpectedTestFramework = expectedTestFramework;
25 | this.ExpectedMockFramework = expectedMockFramework;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Model/SelfTestDetectionsResult.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestDetectionsResult
10 | {
11 | public int TotalCount { get; set; }
12 |
13 | public int SucceededCount { get; set; }
14 |
15 | public IList Failures { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Model/SelfTestFileComparesResult.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestFileComparesResult
10 | {
11 | public int TotalCount { get; set; }
12 |
13 | public int SucceededCount { get; set; }
14 |
15 | public IList Failures { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Model/SelfTestFileFailure.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestFileFailure
10 | {
11 | public string ExpectedFilePath { get; set; }
12 |
13 | public string ActualFilePath { get; set; }
14 |
15 | public string ExpectedContents { get; set; }
16 |
17 | public string ActualContents { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Model/SelfTestInputCombination.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestInputCombination
10 | {
11 | public TestFramework TestFramework { get; set; }
12 |
13 | public MockFramework MockFramework { get; set; }
14 |
15 | public string ClassName { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Model/SelfTestRunResult.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 UnitTestBoilerplate.Model
8 | {
9 | public class SelfTestRunResult
10 | {
11 | public int TotalFilesCount { get; set; }
12 |
13 | public int FilesSucceededCount { get; set; }
14 |
15 | public IList FileFailures { get; set; }
16 |
17 | public int TotalDetectionsCount { get; set; }
18 |
19 | public int DetectionsSucceededCount { get; set; }
20 |
21 | public IList DetectionFailures { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Model/TemplateType.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | public enum TemplateType
4 | {
5 | File,
6 | ExtraUsingNamespaces,
7 | MockFieldDeclaration,
8 | MockFieldInitialization,
9 | MockObjectReference,
10 | TestMethodInvocation,
11 | TestMethodEmpty,
12 | TestMethodName
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Model/TestCleanupStyle.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | ///
4 | /// Determines how code that runs after every test is executed.
5 | ///
6 | public enum TestCleanupStyle
7 | {
8 | Disposable,
9 | AttributedMethod
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Model/TestInitializeStyle.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | ///
4 | /// Determines how code that runs before every test is executed.
5 | ///
6 | public enum TestInitializeStyle
7 | {
8 | Constructor,
9 | AttributedMethod,
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Model/TestProject.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using EnvDTE;
3 |
4 | namespace UnitTestBoilerplate.Model
5 | {
6 | public class TestProject
7 | {
8 | public string Name { get; set; }
9 |
10 | public Project Project { get; set; }
11 |
12 | public string ProjectDirectory => Path.GetDirectoryName(this.Project.FullName);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Model/TestedObjectCreationStyle.cs:
--------------------------------------------------------------------------------
1 | namespace UnitTestBoilerplate.Model
2 | {
3 | ///
4 | /// How the boilerplate will create the object to be tested.
5 | ///
6 | public enum TestedObjectCreationStyle
7 | {
8 | ///
9 | /// A helper method is on the test class and is called by each test.
10 | ///
11 | HelperMethod,
12 |
13 | ///
14 | /// The object is created directly from code with help of the mock library.
15 | ///
16 | DirectCode,
17 |
18 | ///
19 | /// The object is created with TODO stubs for all parameters. Used when no mock library is available.
20 | ///
21 | TodoStub
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UnitTestBoilerplate")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UnitTestBoilerplate")]
13 | [assembly: AssemblyCopyright("")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the values or you can default the Build and Revision Numbers
30 | // by using the '*' as shown below:
31 | // [assembly: AssemblyVersion("1.0.*")]
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/src/Resources/CreateUnitTestBoilerplateCommand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/src/Resources/CreateUnitTestBoilerplateCommand.png
--------------------------------------------------------------------------------
/src/Resources/CreateUnitTestBoilerplateCommandPackage.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/src/Resources/CreateUnitTestBoilerplateCommandPackage.ico
--------------------------------------------------------------------------------
/src/Resources/PackageIcon-90x90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/src/Resources/PackageIcon-90x90.png
--------------------------------------------------------------------------------
/src/Resources/Preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/UnitTestBoilerplateGenerator/b48153bca9fa18f18e8edba3eb0f93649d14af9e/src/Resources/Preview.png
--------------------------------------------------------------------------------
/src/Services/IBoilerplateCache.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 UnitTestBoilerplate.Services
8 | {
9 | public interface IBoilerplateCache
10 | {
11 | void SaveSelectedTestProject(string solutionPath, string testProjectPath);
12 | string GetLastSelectedProject(string solutionPath);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Services/IBoilerplateSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnitTestBoilerplate.Model;
7 |
8 | namespace UnitTestBoilerplate.Services
9 | {
10 | public interface IBoilerplateSettings
11 | {
12 | TestFramework PreferredTestFramework { get; set; }
13 | MockFramework PreferredMockFramework { get; set; }
14 | string FileNameTemplate { get; set; }
15 | IDictionary CustomMocks { get; set; }
16 | string CustomMockFieldDeclarationTemplate { get; set; }
17 | string CustomMockFieldInitializationTemplate { get; set; }
18 | string CustomMockObjectReferenceTemplate { get; set; }
19 | string GetTemplate(TestFramework testFramework, MockFramework mockFramework, TemplateType templateType);
20 | void SetTemplate(string testFrameworkString, string mockFrameworkString, string templateTypeString, string template);
21 | void RevertTemplateToDefault(TestFramework testFramework, MockFramework mockFramework);
22 | void Apply();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Services/IBoilerplateSettingsFactory.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 UnitTestBoilerplate.Services
8 | {
9 | public interface IBoilerplateSettingsFactory
10 | {
11 | IBoilerplateSettings Get();
12 |
13 | void ClearSettingsFileStore();
14 |
15 | bool UsingWorkspaceSettings { get; }
16 |
17 | string UserCreatedSettingsPath { get; set; }
18 |
19 | bool LoadUserCreatedSettings { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Services/IBoilerplateSettingsStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using UnitTestBoilerplate.Model;
7 |
8 | namespace UnitTestBoilerplate.Services
9 | {
10 | ///
11 | /// A store for UTBG settings. Does not provide defaults, just abstracts storage of user-specified values.
12 | ///
13 | public interface IBoilerplateSettingsStore
14 | {
15 | string PreferredTestFrameworkName { get; set; }
16 | string PreferredMockFrameworkName { get; set; }
17 | string FileNameTemplate { get; set; }
18 | IDictionary CustomMocks { get; set; }
19 | string CustomMockFieldDeclarationTemplate { get; set; }
20 | string CustomMockFieldInitializationTemplate { get; set; }
21 | string CustomMockObjectReferenceTemplate { get; set; }
22 | string GetTemplate(string templateSettingsKey);
23 | void SetTemplate(string templateSettingsKey, string template);
24 | void RevertTemplateToDefault(TestFramework testFramework, MockFramework mockFramework);
25 | void Apply();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Services/IFrameworkPickerService.cs:
--------------------------------------------------------------------------------
1 | using EnvDTE;
2 | using System.Collections.Generic;
3 | using UnitTestBoilerplate.Model;
4 |
5 | namespace UnitTestBoilerplate.Services
6 | {
7 | public interface IFrameworkPickerService
8 | {
9 | List FindTestFrameworks(Project project);
10 | TestFramework PickDefaultTestFramework(IList frameworks, IBoilerplateSettings settings);
11 | TestFramework FindTestFramework(Project project, IBoilerplateSettings settings);
12 | List FindMockFrameworks(Project project);
13 | MockFramework PickDefaultMockFramework(IList frameworks, IBoilerplateSettings settings);
14 | MockFramework FindMockFramework(Project project, IBoilerplateSettings settings);
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Services/ISettingsCoordinator.cs:
--------------------------------------------------------------------------------
1 | using UnitTestBoilerplate.Model;
2 |
3 | namespace UnitTestBoilerplate.Services
4 | {
5 | public interface ISettingsCoordinator
6 | {
7 | void RefreshOpenPages();
8 | void ReportSettingsPageClosed(ISettingsPageViewModel settingsPage);
9 | void ReportSettingsPageOpen(ISettingsPageViewModel settingsPage);
10 | void SaveSettingsInOpenPages();
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Services/ITestGenerationService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using UnitTestBoilerplate.Model;
3 |
4 | namespace UnitTestBoilerplate.Services
5 | {
6 | public interface ITestGenerationService
7 | {
8 | Task GenerateUnitTestFileAsync(
9 | ProjectItemSummary selectedFile,
10 | EnvDTE.Project targetProject,
11 | TestFramework testFramework,
12 | MockFramework mockFramework);
13 |
14 | Task GenerateUnitTestFileAsync(
15 | ProjectItemSummary selectedFile,
16 | string targetFilePath,
17 | string targetProjectNamespace,
18 | TestFramework testFramework,
19 | MockFramework mockFramework);
20 |
21 | string GetRelativePath(ProjectItemSummary selectedFile);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Services/MockBoilerplateSettingsFactory.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 UnitTestBoilerplate.Services
8 | {
9 | public class MockBoilerplateSettingsFactory : IBoilerplateSettingsFactory
10 | {
11 | private readonly IBoilerplateSettings settings;
12 |
13 | public MockBoilerplateSettingsFactory(IBoilerplateSettings settings)
14 | {
15 | this.settings = settings;
16 | }
17 |
18 | public IBoilerplateSettings Get()
19 | {
20 | return this.settings;
21 | }
22 |
23 | public void ClearSettingsFileStore()
24 | {
25 | }
26 |
27 | public bool UsingWorkspaceSettings => false;
28 |
29 | public string UserCreatedSettingsPath { get; set; }
30 |
31 | public bool LoadUserCreatedSettings { get; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Services/SettingsCoordinator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using UnitTestBoilerplate.Model;
8 |
9 | namespace UnitTestBoilerplate.Services
10 | {
11 | [PartCreationPolicy(CreationPolicy.Shared)]
12 | [Export(typeof(ISettingsCoordinator))]
13 | public class SettingsCoordinator : ISettingsCoordinator
14 | {
15 | private readonly List openViewModels = new List();
16 |
17 | public void ReportSettingsPageOpen(ISettingsPageViewModel settingsPage)
18 | {
19 | this.openViewModels.Add(settingsPage);
20 | }
21 |
22 | public void ReportSettingsPageClosed(ISettingsPageViewModel settingsPage)
23 | {
24 | this.openViewModels.Remove(settingsPage);
25 | }
26 |
27 | public void RefreshOpenPages()
28 | {
29 | foreach (var openViewModel in this.openViewModels)
30 | {
31 | openViewModel.Refresh();
32 | }
33 | }
34 |
35 | public void SaveSettingsInOpenPages()
36 | {
37 | foreach (var openViewModel in this.openViewModels)
38 | {
39 | openViewModel.SaveCurrentSettings();
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Utilities/FileUtilities.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 UnitTestBoilerplate.Utilities
8 | {
9 | public static class FileUtilities
10 | {
11 | private static readonly List DisallowedCharacters = new List { "\\", "/", "\"", ":", "*", "?", "<", ">", "|" };
12 |
13 | public static string CleanFileName(string fileName)
14 | {
15 | string cleanName = fileName;
16 | foreach (string disallowedChar in DisallowedCharacters)
17 | {
18 | cleanName = cleanName.Replace(disallowedChar, "_");
19 | }
20 |
21 | return cleanName;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/View/CreateUnitTestBoilerplateDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.ComponentModelHost;
2 | using Microsoft.VisualStudio.PlatformUI;
3 | using Microsoft.VisualStudio.Shell;
4 | using System.ComponentModel.Composition;
5 | using UnitTestBoilerplate.ViewModel;
6 |
7 | namespace UnitTestBoilerplate.View
8 | {
9 | ///
10 | /// Interaction logic for CreateUnitTestBoilerplateWindow.xaml
11 | ///
12 | public partial class CreateUnitTestBoilerplateDialog : DialogWindow, ICreateUnitTestBoilerplateView
13 | {
14 | public CreateUnitTestBoilerplateDialog()
15 | {
16 | this.InitializeComponent();
17 |
18 | IComponentModel componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
19 | var viewModel = new CreateUnitTestBoilerplateViewModel();
20 | componentModel.DefaultCompositionService.SatisfyImportsOnce(viewModel);
21 | viewModel.Initialize();
22 | viewModel.View = this;
23 |
24 | this.DataContext = viewModel;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/View/OtherOptionsDialogPageControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 | using Microsoft.VisualStudio.ComponentModelHost;
17 | using Microsoft.VisualStudio.Shell;
18 | using UnitTestBoilerplate.ViewModel;
19 |
20 | namespace UnitTestBoilerplate.View
21 | {
22 | ///
23 | /// Interaction logic for OtherOptionsDialogPageControl.xaml
24 | ///
25 | public partial class OtherOptionsDialogPageControl : UserControl
26 | {
27 | public OtherOptionsDialogViewModel ViewModel { get; }
28 |
29 | public OtherOptionsDialogPageControl()
30 | {
31 | this.InitializeComponent();
32 |
33 | this.ViewModel = new OtherOptionsDialogViewModel();
34 | IComponentModel componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
35 | componentModel.DefaultCompositionService.SatisfyImportsOnce(this.ViewModel);
36 | this.ViewModel.Initialize();
37 | //this.ViewModel.SettingsCoordinator.ReportSettingsPageOpen(this.ViewModel);
38 |
39 | this.DataContext = this.ViewModel;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/View/SelfTestDialog.xaml.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.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Controls.Primitives;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 | using Microsoft.VisualStudio.PlatformUI;
17 | using UnitTestBoilerplate.ViewModel;
18 |
19 | namespace UnitTestBoilerplate.View
20 | {
21 | ///
22 | /// Interaction logic for SelfTestDialog.xaml
23 | ///
24 | public partial class SelfTestDialog : DialogWindow
25 | {
26 | public SelfTestDialog()
27 | {
28 | this.InitializeComponent();
29 |
30 | this.DataContext = new SelfTestViewModel();
31 | }
32 |
33 | private void ScrollChanged(object sender, ScrollChangedEventArgs e)
34 | {
35 | var scrollViewerToUpdate = sender == this.beforeDiff ? this.afterDiff : this.beforeDiff;
36 |
37 | scrollViewerToUpdate.ScrollToVerticalOffset(e.VerticalOffset);
38 | scrollViewerToUpdate.ScrollToHorizontalOffset(e.HorizontalOffset);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/View/WorkspaceSettingsDialogPage.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.ComponentModel;
10 | using Microsoft.VisualStudio.ComponentModelHost;
11 |
12 | namespace UnitTestBoilerplate.View
13 | {
14 | [Guid("97da351a-9f82-433d-b058-22c943b03989")]
15 | public class WorkspaceSettingsDialogPage : UIElementDialogPage
16 | {
17 | private WorkspaceSettingsDialogPageControl workspaceSettingsDialogControl;
18 |
19 | protected override UIElement Child
20 | {
21 | get { return this.workspaceSettingsDialogControl ?? (this.workspaceSettingsDialogControl = new WorkspaceSettingsDialogPageControl()); }
22 | }
23 |
24 | protected override void OnActivate(CancelEventArgs e)
25 | {
26 | base.OnActivate(e);
27 |
28 | this.workspaceSettingsDialogControl.ViewModel.Refresh();
29 | //this.workspaceSettingsDialogControl.ViewModel.Initialize();
30 | }
31 |
32 | protected override void OnApply(PageApplyEventArgs args)
33 | {
34 | //if (args.ApplyBehavior == ApplyKind.Apply)
35 | //{
36 | // this.workspaceSettingsDialogControl.ViewModel.Apply();
37 | //}
38 |
39 | base.OnApply(args);
40 | }
41 |
42 | protected override void OnClosed(EventArgs e)
43 | {
44 | base.OnClosed(e);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/View/WorkspaceSettingsDialogPageControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 | using Microsoft.VisualStudio.ComponentModelHost;
17 | using Microsoft.VisualStudio.Shell;
18 | using UnitTestBoilerplate.ViewModel;
19 |
20 | namespace UnitTestBoilerplate.View
21 | {
22 | ///
23 | /// Interaction logic for WorkspaceSettingsDialogPageControl.xaml
24 | ///
25 | public partial class WorkspaceSettingsDialogPageControl : UserControl
26 | {
27 | public WorkspaceSettingsDialogViewModel ViewModel { get; }
28 |
29 | public WorkspaceSettingsDialogPageControl()
30 | {
31 | this.InitializeComponent();
32 |
33 | this.ViewModel = new WorkspaceSettingsDialogViewModel();
34 | IComponentModel componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
35 | componentModel.DefaultCompositionService.SatisfyImportsOnce(this.ViewModel);
36 | this.ViewModel.Initialize();
37 |
38 | this.DataContext = this.ViewModel;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/View/XamlResources.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/src/ViewModel/CustomMockViewModel.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 UnitTestBoilerplate.ViewModel
8 | {
9 | public class CustomMockViewModel
10 | {
11 | public string Interface { get; set; }
12 |
13 | public string Class { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------