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
[Test] | |
public void Should_$TESTNAME$() | |
{ | |
// arrange | |
$END$ | |
// act | |
// assert |
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 IsolatedDomainScope<T> : IDisposable where T : new() | |
{ | |
private AppDomain _domain; | |
public IsolatedDomainScope() | |
{ | |
_domain = AppDomain.CreateDomain("IsolatedDomainScope:" + Guid.NewGuid(), null, AppDomain.CurrentDomain.SetupInformation); | |
var type = typeof(T); | |
Value = (T) _domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName); |
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 Should_$TESTNAME$() | |
{ | |
//! Arrange | |
$END$ | |
//! Act | |
//! Assert |
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.Reflection; | |
public static class DuckTyping | |
{ | |
private static readonly ConcurrentDictionary<string, PropertyInfo?> _cache = new(); | |
public static object? Get(this object? obj, string propName) | |
{ | |
if (obj == null) return null; |
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>(); |
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
# 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
#!/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
<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
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; |
OlderNewer