Month: August 2022

Uncategorized

NUnit from scratch

https://github.com/nunit/nunit-vs-templates

same here as below, dont want to install all sorts of things extensions etc to scour through exs

https://github.com/nunit/dotnet-new-nunit
skip this, trust me, it is trash ;) and not compatible to open.

https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit

folllow up and self contained repo

https://github.com/flowxcode/nunit-template

according MS docs to test test the tests

https://nunit.org/nunitv2/docs/2.6.4/quickStart.html

started to debug, decided to analyse templates and MS description. building scratch project to debug and build up proper architecture

/unit-testing-using-nunit
    unit-testing-using-nunit.sln
    /PrimeService
        Source Files
        PrimeService.csproj
    /PrimeService.Tests
        Test Source Files
        PrimeService.Tests.csproj

https://docs.educationsmediagroup.com/unit-testing-csharp/nunit/lifecycle-of-a-test-fixture

Lifecycle of a test fixture

As mentioned before, NUnit gives the developer the possibility to extract all initialization and tear-down code that multiple tests might be sharing into ad-hoc methods.

Developers can take advantage of the following facilities to streamline their fixtures

  • A method decorated with a SetUp attribute will be executed before each test
  • A method decorated with a TearDown attribute will be executed after each test
  • A method decorated with a OneTimeSetUp attribute will be executed before any test is executed
  • A method decorated with a OneTimeTearDown attribute will be executed after all tests have been executed
  • The class constructor will be executed before any method and can be used to prepare fields that shouldn't be modified while executing the tests.

Additionally, developers can set up fixtures contained in a namespace and all its children by creating a class decorated with the attribute SetUpFixture. This class will be able to contain methods decorated with OneTimeSetUp and OneTimeTearDown attributes.

NUnit supports multiple SetUpFixture classes: in this case, setup methods will be executed starting from the most external namespace in and the teardown from the most internal namespace out.

nunit

References:

https://automationintesting.com/csharp/nunit/lessons/whataretestfixtures.html

Uncategorized

secure authentication

read the counter of auth attempts:

https://globalplatform.org/specs-library/card-specification-v2-3-1/

The INITIALIZE UPDATE command is used, during explicit initiation of a Secure Channel, to transmit card and session data between the card and the host. This command initiates the initiation of a Secure Channel Session.

read the counter of apdu.

findings: counter ist increasing in 2 apdu responses

https://www.rapidtables.com/convert/number/hex-to-decimal.html

https://www.scadacore.com/tools/programming-calculators/online-hex-converter/

Uncategorized

NUnit setup tmr for test setup

things tbd tmr , details tobe provided and worked out

  • SetUpAttribute is now used exclusively for per-test setup.
  • TearDownAttribute is now used exclusively for per-test teardown.
  • OneTimeSetUpAttribute is used for one-time setup per test-run. If you run n tests, this event will only occur once.
  • OneTimeTearDownAttribute is used for one-time teardown per test-run. If you run n tests, this event will only occur once
  • SetUpFixtureAttribute continues to be used as at before, but with changed method attributes.