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 AbstractLocalSyncRunner { | |
protected AbstractLocalSyncRunner() { | |
} | |
protected virtual void RunAsyncCore(ILocalSynchronizationContextRef inLocalContext, Func<SynchronizationContext, Task> inTestAction) { | |
inLocalContext.Start(); | |
try { | |
inLocalContext.Reference.Post(obj => { | |
var task = inTestAction(inLocalContext.Reference); |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using NUnit.Framework; | |
namespace Samples { | |
public static class AssertPlus { |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using NUnit.Framework; | |
namespace Samples { | |
public class AssertRequired<TResult> where TResult : class, new() { |
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 ComplexBusinessOperations | |
{ | |
private int moneyEarnedSoFar; | |
public int MoneyEarnedSoFar | |
{ | |
get { return moneyEarnedSoFar; } | |
} | |
public void EarnMoney(int investment) |
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 ComplexBusinessOperations | |
{ | |
private int moneyEarnedSoFar; | |
public int MoneyEarnedSoFar | |
{ | |
get { return moneyEarnedSoFar; } | |
} | |
public void EarnMoney(int investment) |
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
// In CUI test runner, to use await syntax at the test code is involved skipping test. | |
// So It nessesary to wait using Task#Wait() method. | |
// In Assert#Throws method for NUnit, threfore, expected exception is not thrown but AggregateException. | |
// Following method is conversion AggregateException to the internal exception. | |
private TestDelegate ResolveAggregateException(Action inTestAction) { | |
return () => { | |
try { | |
inTestAction(); | |
} | |
catch (AggregateException 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace Samples { | |
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | |
public class PropertyCategoryAttribute : System.Attribute { | |
public PropertyCategoryAttribute(Type inTagType) { | |
this.Tag = inTagType; |
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
// | |
// Maximum Duplication String Problem for F# | |
// | |
let dupstr s = | |
// generate suffix list | |
let tails (s:string) = | |
let rec tailsimpl (s:string) i list = | |
match i with | |
| -1 -> list |
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 Sample { | |
public static class LimittedStringExtensions { | |
public string LimmitedString(this string inSelf, int inMaxLen) { | |
if (inSelf.Length > inMaxLen) { | |
throw new Exception("長すぎwwwワロタwww"); | |
} | |
return inSelf; | |
} | |
} |
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
<!-- | |
<Page | |
x:Class="APTest.App.BlankPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:APTest.App" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
xmlns:fw="clr-namespace:AP.Framework;assembly=AP.Framework" |