Skip to content

Instantly share code, notes, and snippets.

View darrelmiller's full-sized avatar

Darrel darrelmiller

View GitHub Profile
var runscopeHandler = new RunscopeMessageHandler("bucketKey", new HttpClientHandler());
var httpClient = new HttpClient(runscopeHandler);
var response = await httpClient.GetAsync("https://api.github.com");
var client = new HttpClient();
var runscopeLink = new RunScopeLink() {
Target = new Uri("https://api.github.com"),
BucketKey = "bucket_key"
};
var response = client.SendAsync(runscopeLink.CreateRequest()).Response;
[Scenario]
public void RetrievingIssues(IEnumerable<Issue> issues, Mock<IIssueStore> issueStore )
{
var mockIssueStore = new Mock<IIssueStore>();
var fakeIssues = GetFakeIssues();
var controller = new IssueController(mockIssueStore.Object);
"Given existing issues".
f(() => mockIssueStore.Setup(i => i.FindAsync()).Returns(Task.FromResult(fakeIssues)));
"When a GET request is made for all issues".
public class StringExtensionsSpecifications
{
[Scenario]
[Example("Given", StepType.Given)]
[Example("When", StepType.When)]
[Example("Then", StepType.Then)]
[Example("But", StepType.But)]
[Example("And", StepType.And)]
public void GetStepType(string clause, StepType expected, StepType actual)
{
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace SimpleHttpClient
{
class Program
{
private static Uri url = new Uri("http://bing.com/");
config.Routes.Add("default", new TreeRoute("",new TreeRoute("home").To<HomeController>(),
new TreeRoute("contact",
new TreeRoute("{id}",
new TreeRoute("address",
new TreeRoute("{addressid}").To<ContactAddressController>())
).To<ContactController>())
)
);
<Hpr>
<pages>
<page>
<type>DefFeatures</type>
<href>6.2/615/WW/en-us/0/76/features.json</href>
</page>
<page>
<type>MSFeatures</type>
<href>6.2.1.0/100/CA/en-us/MS/232/features9bc05c7c-e8b6-4341-a379-bc3d042e6458.json</href>
</page>
using System;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Routing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace TestRoutes
{
[TestClass]
public class RouteTests {
public class BingMapLink : Link
{
public BingMapLink()
{
Target = new Uri("http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/{lat},{long}/{level}?mapSize={mapsize}&key={apikey}");
SetParameter("level", 10);
SetParameter("mapsize", "500, 500");
}
Here's a report that show the weight of material currently being worked on...
SELECT CASE WHEN @@LANGID = 0 THEN cat.Description ELSE cat.Description_2 END AS ChargeAccountType,
ca.Code AS ChargeAccount_Code,
ca.Description AS ChargeAccount_Description,
ROUND(pw.TotalWeight / 2000.0,2) AS TotalWeight,
ROUND(pw.BoltWeight /2000.0,2) AS BoltWeight,
ROUND(pw.ReleasedWeight / 2000.0,2) AS ReleasedWeight,
ROUND(pw.FabricatedWeight / 2000.0,2) AS FabricatedWeight,