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
class Point | |
{ | |
override bool Equals(object other) | |
{ | |
return this.X == ((Point)other).X && this.Y == ((Point)other).Y; | |
} | |
} | |
new Point(...).Equals(new Bar(...)) |
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
[TestMethod] | |
public void TestMethod1() | |
{ | |
var x = 0; | |
Task.Run(() => | |
{ | |
Thread.Sleep(TimeSpan.FromSeconds(1)); | |
x++; | |
}); |
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
interface IFooStatusReportsListener | |
{ | |
void Notify(string productName, BarStatus[] barStatuses); | |
} | |
class BarClient | |
{ | |
readonly HttpClient _httpClient = new HttpClient {BaseAddress = new Uri("https://bar.example.com/")}; | |
public async void UpdateShippingStatusReports(string product, IFooStatusReportsListener listener) |
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
static class VerifyThatValueEqualityIsImplementedCorrectly | |
{ | |
public static void ShouldBeEqual<T>(T item, T equalItem) | |
where T : IEquatable<T> | |
{ | |
var equatable = (IEquatable<T>) item; | |
equatable.Equals(equalItem).Should().BeTrue("IEquatable<>.Equals"); | |
equatable.Equals(item).Should().BeTrue("IEquatable<>.Equals(self)"); | |
equatable.Equals(null).Should().BeFalse("IEquatable<>.Equals(null)"); |
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
internal interface IUserSettings | |
{ | |
Task<bool> GetFlag(string name); | |
Task SetFlag(string name, bool value); | |
} | |
internal abstract class UserSettingsTestsBase | |
{ | |
protected abstract IUserSettings CreateSubject(); |
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
// Tests for A | |
result = new A(fakeB).F(); | |
// Tests for B | |
result = new B().G(); | |
// Tests that they work together | |
subject = new A(new B()); | |
result = subject.F(); |
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
class A | |
{ | |
ctor(B b) | |
{ | |
this.b = b; | |
} | |
public F() | |
{ | |
// Something that doesn't use B |
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
class B | |
{ | |
A a = new A(); | |
public F() | |
{ | |
return a.G(...); | |
} | |
} |
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
static bool ShouldAcceptConnectionRequest(bool firstUserHasConnections, bool secondUserHasConnections) | |
{ | |
return !firstUserHasConnections && !secondUserHasConnections; | |
} |
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
# START http://boxstarter.org/package/url?https://gist.githubusercontent.com/JayBazuzi/7b22dcb5d0ba3d326a99/raw/24fe6d3946337474ea292227a18e4fd529055a92/BoxStarterADM.ps1 | |
Set-ExecutionPolicy RemoteSigned -Force | |
Set-WindowsExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
cinst chocolatey | |
cinst vs2013.4 | |
cinst ncrunch-vs2013 | |
cinst vs2013.4 |