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
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
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
annotation class foo | |
foo class 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
using System.Threading.Tasks; | |
using NSubstitute; | |
using NUnit.Framework; | |
namespace ClassLibrary1 | |
{ | |
public interface ICalculationServiceAsync | |
{ | |
Task Calculate(); | |
} |
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
[TestFixture] | |
public class MockingAsyncTask | |
{ | |
[Test] | |
public async void can_mock_interface_methods_with_task_return() | |
{ | |
var mock = NSubstitute.Substitute.For<ILongRunningOperation>(); | |
var sut = new SystemUnderTest {Operaiton = mock}; | |
await sut.Execute(); |
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 ActionResult HandleException() | |
{ | |
return HandleException(new Exception("An Exception Has Occurred")); | |
} | |
public ActionResult HandleException(Exception ex) | |
{ | |
throw ex; | |
} |
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
// Copyright 2004-2012 Castle Project - http://www.castleproject.org/ | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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 System.Drawing.Imaging | |
{ | |
public enum PixelFormat | |
{ | |
DontCare = 0, | |
Undefined = 0, | |
Max = 15, | |
Indexed = 65536, | |
Gdi = 131072, | |
Format16bppRgb555 = 135173, |
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 IEnumerable<IResult> LoadReport(int reportId) | |
{ | |
yield return Display.Busy(); | |
var service = new ReportingServiceClient(); | |
yield return Display.ChangeStatus("Preparing Reports..."); | |
yield return new WebServiceResult().Invoke(service.PrepareReports); |
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
[TestFixture] | |
public class DefaultDecoderTests | |
{ | |
[Test] | |
public void XmlAttributes_Are_Not_Converted_To_Elements() | |
{ | |
var customerRaw = @"<Customer Mode=""Add""> | |
<CustomerNo>02121V</CustomerNo> | |
</Customer>"; |
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
[TestFixture] | |
public class XmlDecoderTests | |
{ | |
[Test] | |
public void can_decode_xml_response_as_static_object() | |
{ | |
IDecoder decoder = new XmlDecoder(); | |
var xml = GetXmlContent(); | |
var customer = decoder.DecodeToStatic<Customer>(xml, HttpContentTypes.ApplicationXml); |
NewerOlder