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
Set-CornerNavigationOptions -EnableUpperRightCornerShowCharms -EnableUpperLeftCornerSwitchApps -EnableUsePowerShellOnWinX | |
Update-ExecutionPolicy RemoteSigned | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions | |
Enable-RemoteDesktop | |
Install-WindowsUpdate -acceptEula | |
#cinst sublimetext3 sublimetext3.packagecontrol | |
#cinst 7zip | |
cinst googlechrome |
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
void Caller1(C c, I i) | |
{ | |
c.F1(); // No warning | |
c.F2(); // CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. | |
i.F3(); // No warning | |
} | |
async Task Caller2(C c, I i) | |
{ | |
c.F1(); // CS4014 |
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 HttpRequestMessageList : List<HttpRequestMessage> | |
{ | |
public void Add(string uri, HttpMethod httpMethod) | |
{ | |
this.Add(new HttpRequestMessage(httpMethod, uri)); | |
} | |
} |
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 RouteToGetUser() | |
{ | |
var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:4567/api/users/me"); | |
var config = new HttpConfiguration(); | |
WebApiConfig.Register(config); | |
config.EnsureInitialized(); | |
var result = config.Routes.GetRouteData(request); |
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 C | |
{ | |
public void F() | |
{ | |
} | |
public static readonly C C1 = new C {S = "sldkfjsldf"}; | |
// public static readonly C C2 = new C {S = C1.S}; | |
// public static readonly C C2 = new C {S = "sdflskdfj"}; | |
public string S; |
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 Foo | |
{ | |
private readonly IEvents _events; | |
public Foo(IEvents events) | |
{ | |
_events = events; | |
} | |
public interface IEvents |
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 C : B | |
{ | |
string s; | |
public C() | |
{ | |
s = "hi"; | |
} | |
protected override void F() | |
{ | |
Console.WriteLine(s.Length); // NullReferenceException |
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
[TestClass] | |
public class CustomerTest | |
{ | |
private const string DavidName = "David"; | |
private const string JohnName = "John"; | |
private const string PatName = "Pat"; | |
private const string SteveName = "Steve"; | |
private readonly Customer[] _customers; | |
private readonly Customer _david; | |
private readonly Customer _john; |
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
abstract class AdapterTestsBase | |
{ | |
public abstract IPort CreateSubject(); | |
[TestMethod] | |
public void FShouldBlah() | |
{ | |
IPort subject = CreateSubject(); | |
int result = subject.F(); | |
Assert.AreEqual(7, result); |
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 void Main() | |
{ | |
Test_PrimeFactorsOf14ShouldBe3(); | |
Test_PrimeFactorsOf14ShouldBe1_2_7(); | |
} | |
static void Test_PrimeFactorsOf14ShouldBe3() | |
{ | |
var result = CalculatePrimeFactors(3); | |
if (!result.SequenceEqual(new[] { 3 })) |