This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const firstArray = [ 1, 2, 3]; // Prettier will still format this line with its defaults | |
// prettier-ignore | |
const secondArray = [ | |
4, | |
5, | |
6 | |
]; | |
const somethingElse = 'blah'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void AddShouldSumNumbers() | |
{ | |
var result = CalculatorService.Add(1, 1); | |
result.Should().Be(3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void AddShouldSumNumbers() | |
{ | |
var result = CalculatorService.Add(1, 1); | |
Assert.Equal(3, result); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void AddShouldSumNumbers() | |
{ | |
var result = CalculatorService.Add(1, 1); | |
Assert.True(result == 3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pages constants class | |
public class AdministratorPages | |
{ | |
public const string Base = "/Administrator"; | |
public static string Index = $"{Base}/Index"; | |
public static string EmployeesIndex = $"{Base}/Employees/Index"; | |
} | |
// Usage in a View | |
<a asp-page="@AdministratorPages.Index">Administrator Home Page</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk.Worker"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterTests : TestContext | |
{ | |
[Fact] | |
public void ShouldIncrementCountWhenButtonIsClicked() | |
{ | |
var counterComponent = RenderComponent<Counter>(); | |
counterComponent.Find("button").Click(); | |
// Asserts actual user behavior |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterTests : TestContext | |
{ | |
[Fact] | |
public void ShouldIncrementCountWhenButtonIsClicked() | |
{ | |
var counterComponent = RenderComponent<Counter>(); | |
counterComponent.Find("button").Click(); | |
// This assertion tests that the state has incremented by 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/counter" | |
<h1>Counter</h1> | |
<p id="current-count">Current count: @CurrentCount</p> | |
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | |
@code { | |
public int CurrentCount { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using JetBrains.Annotations; | |
using Microsoft.AspNetCore.Mvc.Razor; | |
// These annotations make Resharper not complain about not finding the Views. | |
// ASP.NET Core support coming to R# for Feature Folders soon - https://youtrack.jetbrains.com/issue/RSRP-461882 | |
[assembly: AspMvcViewLocationFormat("/Features/{1}/{0}.cshtml")] | |
[assembly: AspMvcViewLocationFormat("/Features/Shared/{0}.cshtml")] | |
[assembly: AspMvcPartialViewLocationFormat("~/Features/{1}/{0}.cshtml")] | |
[assembly: AspMvcPartialViewLocationFormat("~/Features/Shared/{0}.cshtml")] |