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 MailKit.Net.Smtp; | |
using MimeKit; | |
using MimeKit.Text; | |
using RazorHtmlEmails.RazorClassLib.Services; | |
using RazorHtmlEmails.RazorClassLib.Views.Emails.ConfirmAccount; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace RazorHtmlEmails.Common; |
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
<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
var configurationBuilder = new ConfigurationBuilder() | |
.AddJsonFile("appsettings.json") | |
.AddJsonFile($"appsettings.{Environment}.json"); | |
if (Environment.IsDevelopment()) | |
{ | |
configurationBuilder.AddUserSecrets(); | |
} | |
configurationBuilder.AddEnvironmentVariables(); |
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
[Authorize(PolicyName="Admin")] | |
public class IndexModel : PageModel | |
{ | |
public void OnGet() | |
{ | |
// do something | |
} | |
} |