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 MyClassTests | |
{ | |
public class Method1 : MyClassTestsBase | |
{ | |
[Theory] | |
[AutoData] | |
public async Task Should_return_A_when_X(parameters) | |
{ | |
//! Arrange | |
// ... |
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 AutoFixture.Kernel; | |
/// <summary> | |
/// AutoFixture random generator for enums | |
/// </summary> | |
public class RandomEnumGenerator : ISpecimenBuilder | |
{ | |
private static readonly Random _randomizer = Random.Shared; |
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.Dynamic; | |
public class ObjectMerger : IObjectMerger | |
{ | |
/// <summary> | |
/// Merges two anonymous objects. | |
/// https://stackoverflow.com/questions/6754967/merging-anonymous-types | |
/// </summary> | |
public dynamic? Merge(object? item1, object? item2) | |
{ |
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.Security.Cryptography; | |
using System.Text; | |
/// <summary> | |
/// Encrypt and decrypt a string with a pass phrase. | |
/// // https://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp | |
/// </summary> | |
public class CryptoService : ICryptoService | |
{ |
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 AutoFixture; | |
using AutoMapper; | |
/// <summary> | |
/// Base class for AutoMapper tests (one profile). | |
/// </summary> | |
/// <typeparam name="TProfile">Mappings profile</typeparam> | |
public abstract class AutoMapperTestsBase<TProfile> where TProfile : Profile, new() | |
{ | |
protected readonly Fixture Fixture; |
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
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | |
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=202E5F32AF467445AA17792D97AF1C26/@KeyIndexDefined">True</s:Boolean> | |
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=202E5F32AF467445AA17792D97AF1C26/EntryName/@EntryValue">ForwardOnlyMigration</s:String> | |
<s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=202E5F32AF467445AA17792D97AF1C26/Position/@EntryValue">6</s:Int64> | |
<s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/QuickList/=F0CA621CDF5AB24282D8CDC11C520997/Entry/=2CBD6971A7955044AD2624B84FB49E38/Position/@EntryValue">11</s:Int64> | |
<s: |
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
#!/bin/sh | |
### Do not change below | |
# Retrieve version | |
TMPVERS=$(nvram get webs_state_info) | |
echo "$TMPVERS" | grep 382 | |
if [ $? -ne 0 ]; then | |
VERS=${TMPVERS:5:3}.${TMPVERS:8:10} | |
else | |
VERS=$TMPVERS |
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
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#formatting-conventions | |
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2017 | |
# https://github.com/dotnet/roslyn/blob/master/.editorconfig | |
# https://medium.com/@jonjam/c-code-style-using-editorconfig-9d38de65527d | |
# https://github.com/kentcb/EditorConfigReference/blob/master/.editorconfig | |
# https://github.com/RehanSaeed/EditorConfig/blob/master/.editorconfig | |
# https://www.jetbrains.com/help/rider/Using_EditorConfig.html |
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.Concurrent; | |
using System.ComponentModel; | |
using System.Reflection; | |
public static class EnumExtensions | |
{ | |
private static readonly ConcurrentDictionary<string, string> _descriptionsByEnumMemberName = new(); | |
public static string GetDescription<T>(this T value) where T : Enum | |
{ |
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
// Bind ILoggerFactory to LoggerFactory | |
// Bind typeof(ILogger<>) to typeof(LoggingAdapter<>) | |
public class LoggingAdapter<T> : ILogger<T> | |
{ | |
private readonly Microsoft.Extensions.Logging.ILogger _logger; | |
public LoggingAdapter(ILoggerFactory factory) | |
{ | |
_logger = factory.CreateLogger<T>(); |
NewerOlder