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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string] | |
$RiderHome | |
) | |
function Update-WindowsDefenderForRider { | |
[CmdletBinding()] | |
param ( |
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
namespace Gist | |
{ | |
using FluentAssertions.Execution; | |
using Xunit; | |
public class MyCustomAssertionsFacts | |
{ | |
[Fact] | |
public void DoesNotPrintContextNicely() | |
{ |
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
namespace Rider | |
{ | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit; | |
public class FaultyExtensionMethodResolution | |
{ | |
[Fact] | |
public void RiderResolvesWrongExtensionMethod() |
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
namespace LinkedList | |
{ | |
public class List<T> : IEnumerable<T>, IEnumerator<T> | |
{ | |
public IEnumerator<T> GetEnumerator() | |
{ | |
this.current = null; | |
return this; | |
} |
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 class JsonTextDeserializerOnly : ISerialize | |
{ | |
public void Serialize<T>(Stream output, T graph) | |
{ | |
throw new NotSupportedException("serialization should not be required"); | |
} | |
public T Deserialize<T>(Stream input) | |
{ | |
if (typeof(T) == typeof(List<EventMessage>)) |
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
// I would like to make sure, both exceptions are packed into the AggregateException | |
[TestMethod] | |
public void ShouldThrowAggregateException() | |
{ | |
Action act = () => | |
{ | |
throw new AggregateException(new Exception(), new ArgumentException()); | |
}; | |
act.ShouldThrow<AggregateException>() |
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 static class MyCollectionAssertionExtensions | |
{ | |
public static AndConstraint<StringCollectionAssertions> ContainMagic(this StringCollectionAssertions assertions) | |
{ | |
Execute.Assertion | |
.ForCondition(assertions.Subject.As<MyType>().ContainsMagicString()) | |
.FailWith("No, there's no magic"); | |
return new AndConstraint<StringCollectionAssertions>(assertions); | |
} |
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
The expression in the code looks like this: | |
var list = new List<string>(); | |
Assert.AreEqual(3, list.Count); | |
Search part of ssp: | |
Assert.AreEqual($expected$, $actual$.Count); | |
both variables match "exactly one argument". I've turned on "Match similar constructs" | |
Replace part of ssp: |
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
function Tfs-UpdateFeature { | |
[CmdletBinding()] | |
param () | |
DynamicParam { | |
$RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary | |
$FeatureParameter = New-DynamicParameter -ParameterName "Feature" -AllowedValues {(git branch --list) | ForEach-Object { $_.Substring(2) }} -Position 0 -Aliases @("b","f") -Mandatory | |
$BranchParameter = New-DynamicParameter -ParameterName "MainBranch" -AllowedValues {(git branch --list) | ForEach-Object { $_.Substring(2) }} -Position 1 | |
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 class Test | |
{ | |
[Fact] | |
public void MapChildViewModel() | |
{ | |
Mapper.CreateMap<ViewModel, Dto>(); | |
var childViewModel = new ChildViewModel | |
{ | |
ChildId = 5, |
NewerOlder