CustomerTestsExcel 2.0.4

dotnet add package CustomerTestsExcel --version 2.0.4                
NuGet\Install-Package CustomerTestsExcel -Version 2.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CustomerTestsExcel" Version="2.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CustomerTestsExcel --version 2.0.4                
#r "nuget: CustomerTestsExcel, 2.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CustomerTestsExcel as a Cake Addin
#addin nuget:?package=CustomerTestsExcel&version=2.0.4

// Install CustomerTestsExcel as a Cake Tool
#tool nuget:?package=CustomerTestsExcel&version=2.0.4                

Customer Tests Excel

Build status

codecov

Maintainability

A framework to round trip NUnit to / from Microsoft Excel customer tests.

Created as a replacment for Fitnesse. RES is primarily a science and engineering company, and due to the calculation heavy nature of the work, none of the existing customer test frameworks are a good fit.

Advantages

  • Tests are expressed in Microsoft Excel Spreadsheets, which our customers are familiar with, and which support any complexity of calculation
  • Tests are converted to C# / NUnit, and make use of existing tooling (which aids debugging, coverage, Continuous Integration etc)
  • Automated refactoring can be done in C#, using existing tooling, and then the changes written back to Excel
  • The NUnit tests are generated from Excel, so the two are guaranteed to be in sync
  • Most scaffolding code can be generated, you usually only need to supply the code to call your system under test

Usage

The easiest way to get started is to use the scaffolding project.

However you can do it manually

  • Create a new project (.csproj) for the Customer Tests
  • Install the Nuget Package CustomerTestsExcel
  • Install the Nuget Package CustomerTestsExcel
  • Create an ExcelTests folder within the Customer Test project folder
  • Create an Excel Spreadsheet in the ExcelTests subfoloder, with a Test (see below for format).
  • Run GenerateCodeFromExcelTest.exe to create / update the C# test project
  • For example GenerateCodeFromExcelTest.exe /folder "CustomerTests" /project CustomerTests.csproj /namespace CustomerTests /usings "SystemUnderTest" /assertionClassPrefix "I"
  • GenerateCodeFromExcelTest.exe will be in the tools folder of the nuget package (for example CustomerTestsExcel.1.0.1\tools)
  • /folder is the folder of the Customer Test project relative to the current working directory
  • /project is the name of the project
  • `/namespace' is the namespace to use for the tests
  • /usings' is space delimited list of namespaces that will be added as using` statements to the tests
  • /assertionClassPrefix is added to the Excel assertion type names when creating the C# names.
  • Open the Customer Test project in Visual Studio (For example SampleTests\SampleTests.csproj)
  • Put any custom code under a IgnoreOnGeneration folder, so that it will remain when the test project is regenerated.
  • To create the Excel Spreadsheet from the C# code (should you need to)
    • Set a CUSTOMER_TESTS_EXCEL_WRITE_TO_EXCEL environment variable to true
    • Set a CUSTOMER_TESTS_RELATIVE_PATH_TO_EXCELTESTS environment variable from the Output Folder (for example bin\debug) to the ExcelTests folder
    • Run the tests

See the SampleTests and SampleSystemUnderTest projects for examples.

The Excel test for the Rerouting example (SampleTests/ExcelTests/Rerouting.xlsx) looks like this:

Example Excel Test

Building Locally

  • CustomerTestsExcel.sln

Build Server (private to RES)

End to End testing

The SampleTests project performs both documentation and End to End testing

During the AppVeyor build, the SampleTests Excel spreadsheets are converted in to C# tests, these tests are then run to re-create the spreadsheets, and then the spreadsheets are converted back in to C# again. This ensures that all the conepts contained within the spreadsheets are round trippable.

Deploying the Nuget Package

Click "Deploy" on the relevant AppVeyor build if you have access to it.

Otherwise

  • msbuild.exe CustomerTestsExcel.sln /p:Configuration=Release
  • nuget restore
  • nuget pack CustomerTestsExcel.csproj -build
  • push .nupkg to a feed
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.4 1,217 9/23/2020
1.0.2 779 10/31/2018

The test project is now expected to be .Net Core (the project under test can be either Core or Framework).
 The framework can now scan assemblies / dlls for interfaces that match the definitions in the Excel tests, and generate the setup classes automatically.
 The syntax or setting up lists is now ".. list of" instead of "...(n)"
 The framework tries to spot syntax problems in the Excel files and now provides warnings / errors for them.