Skip to content
| Marketplace
Sign in
Visual Studio>Tools>AAASnippet
AAASnippet

AAASnippet

Tajko

|
1,293 installs
| (1) | Free
A set of useful snippets to generate default methods for xUnit (Test, Fact, theory, async), NUnit (Test, async) methods with AAA or just AAA (Arrange, Act, Assert) comments
Download

AAASnipped

Summary

This is "code snippets" which can come in handy when writing tests in xUnit/NUnit, among others. I came up with this idea today while learning unit tests, from the fact that I didn't want to write AAA (Arrange, Act, Assert) every now and then, and I couldn't find a ready-made nuget that would have it, I decided to check on the Internet how you can write such a package and such a snippet yourself, after a few hours ready:). I tested it on Visual Studio 2022 Community, but on other versions it should also work.

This will save you a lot of time in creating unit methods on xUnit / NUnit framework.

obraz_2022-08-20_081113616.png

How to install

  1. Download "AAASnippet... .vsix" (Microsoft Visual Studio Extension) file from "Visual Studio Gallery" site.
    URL: AAASnippet or install from Extensions in Visual Studio
  2. Open (double click on Explorer) the downloaded "AAASnippet... .vsix" file.
  3. Then, "VSIX Installer" was launched. Please click "Install".

How to use

Display AAA (Arrange, Act, Assert)

  • a [Tab]

Then, this snippet expanded following C# code.

// Arrange


// Act


// Assert

xUnit - Create Fact method with AAA

On C# source code in Visual Studio, you can insert xUnit Fact method by following key typing.

  • fa [Tab]
[Fact]
public void MyTestMethod()
{
    // Arrange
    
    
    // Act
    
    
    // Assert
    
}

xUnit - Create Fact method with DisplayName and AAA

  • fad [Tab]
[Fact(DisplayName = "MyTestMethod")]
public void MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Fact async method with AAA

  • fas [Tab]
[Fact]
public async Task MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Fact async method with DisplayName and AAA

  • fasd [Tab]
[Fact(DisplayName = "MyTestMethod")]
public async Task MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Theory method with AAA

  • ta [Tab]
[Theory]
public void MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Theory method with DisplayName and AAA

  • tad [Tab]
[Theory(DisplayName = "MyTestMethod")]
public void MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Theory async method with AAA

  • tas [Tab]
[Theory]
public async Task MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

xUnit - Create Theory async method DisplayName and AAA

  • tasd [Tab]
[Theory(DisplayName = "MyTestMethod")]
public async Task MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

NUnit - Create Test method with AAA

  • tta [Tab]
[Test]
public void MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

NUnit - Create Test async method with AAA

  • ttas [Tab]
[Test]
public async Task MyTestMethod()
{
    // Arrange


    // Act


    // Assert

}

Release Note

  • v.1.0.0.6
    • Trying to fix a bug with CoreEditor in Visual Studio 2022 Pro. If someone had a problem then try manually installing the "Visual Studio extension development" extension, which includes CoreEditor
  • v.1.0.0.5
    • First release, it contains a, fa, fad, fas, fasd, ta, tad, tas, tasd, tta, ttas snippet.

Support

If you would like to somehow repay me for my work in the form of ramen, for example, you can find more information here (PL): SuppMe

License

GNU GPL v.3

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft