This file contains hidden or 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 abstract class TestBase | |
{ | |
protected abstract Task Impl(); | |
protected abstract void Impl2(); | |
} | |
public class Test : TestBase | |
{ | |
protected override Task Impl() | |
{ |
This file contains hidden or 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 abstract class BaseImplementation | |
{ | |
public abstract void GoToCut(MiniMachine m, Cut cut, bool isScanning); | |
public abstract void CutMe(MiniMachine m, Cut cut); | |
public abstract void ScanMe(MiniMachine m, Cut cut); | |
} | |
public interface ICuttingImpl |
This file contains hidden or 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
double[] base1 = {1,2,3,4,5,6}; | |
var ret = new TushinoDb(); | |
for (int i = 1; i < 7; i++) ret.AddCut(new TushinCut(base1[i-1] , 2)); |
This file contains hidden or 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
image: mcr.microsoft.com/dotnet/core/sdk:3.1 | |
stages: | |
- build | |
- test | |
build: | |
stage: build | |
script: | |
- cd tortest2 | |
- dotnet restore scraperTest.sln |
This file contains hidden or 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
image: mcr.microsoft.com/dotnet/core/sdk:3.1 | |
stages: | |
- build | |
build: | |
stage: build | |
script: | |
- cd tortest2 | |
- dotnet restore scraperTest.sln |
This file contains hidden or 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
image: mcr.microsoft.com/dotnet/core/sdk:3.1 | |
stages: | |
- build | |
- test | |
- release | |
- deploy |
This file contains hidden or 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
A. Развозка фанатов | |
Ограничение времени 1 секунда | |
Ограничение памяти 64Mb | |
Ввод стандартный ввод или input.txt | |
Вывод стандартный вывод или output.txt | |
После футбольного матча фанаты пытаются уехать домой на такси. Чтобы сэкономить, они объединяются в группы: фанат присоединяется к группе, если знает хотя бы одного человека из неё, группа хочет ехать исключительно в одной машине, а две разные группы отказываются ехать вместе. Таксопарк владеет ограниченным числом машин заданной вместимости. Определите, получится ли у таксопарка развезти экономных фанатов. | |
Формат ввода |
This file contains hidden or 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
return true switch | |
{ | |
_ when a == b => 1, | |
_ when foo == "foobar" => 2, | |
_ when someFunction() => 3, | |
_ => 4, | |
}; | |
https://www.reddit.com/r/csharp/comments/dccpx9/using_pattern_matching_to_replace_lengthy_ifelse/ |
This file contains hidden or 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
It took me too much time to get it working, so I'll describe steps of how to use UserSecrets in testing. | |
1. Create Unit test project for .net core | |
2. reference Microsoft.AspNetCore.Mvc.Testing , Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.UserSecrets | |
3. Add a user secret tag to your assembly: | |
[assembly: UserSecretsId("your_user_secret_id")] | |
namespace XUnitTestProject1 | |
{ | |
... |
This file contains hidden or 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 Microsoft.Extensions.Configuration; | |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace Doge.Utils | |
{ |