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 Scratch | |
{ | |
public class Tester | |
{ | |
public class Taco<T> | |
{ | |
public T Filling { get; set; } | |
public Taco(T value) | |
{ |
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 Scratch | |
{ | |
public class Tester | |
{ | |
public class Taco<T> | |
{ | |
public T Filling { get; set; } | |
public Taco(T value) | |
{ |
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 SyncData<TResult> | |
{ | |
public TResult Result { get; set; } | |
public SyncData(TResult result) | |
{ | |
Result = 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
public class Response<T> | |
{ | |
public static implicit operator bool(Response<T> response) | |
{ | |
return response.Success; | |
} | |
public bool Success { get; private set; } | |
public T Value { get; private set; } | |
public Response(bool success, T value) |
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
require 'rexml/document' | |
def build(test_project) | |
`msbuild /nologo #{test_project}` | |
end | |
def mstest(test_container, test_results_file, tests_to_run) | |
tests_to_run = ([""] << tests_to_run).flatten | |
File.delete(test_results_file) if File.exists?(test_results_file) |
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
require 'autotest.rb' | |
watch( '^.*UnitTest.*.cs$' ) do |match| | |
run_test(match.to_s) | |
end |
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
[Test] | |
public void AwesomeTest() | |
{ | |
var objectWithEvent = new ClassWithEvent(); | |
var awesomeTracker = new EventTracker<EventHandler>(); | |
objectWithEvent.AwesomeEvent += awesomeTracker.Delegate; | |
objectWithEvent.DoSomethingAwesome(); |
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
[Test] | |
public void LessLameTest() | |
{ | |
var objectWithEvent = new ClassWithEvent(); | |
var awesomeCount = 0; | |
objectWithEvent.AwesomeEvent += ( o, e ) => awesomeCount++; | |
objectWithEvent.DoSomethingAwesome(); |
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
[Test] | |
public void LameTest() | |
{ | |
var objectWithEvent = new ClassWithEvent(); | |
var awesomeFired = false; | |
objectWithEvent.AwesomeEvent += ( o, e ) => awesomeFired = true; | |
objectWithEvent.DoSomethingAwesome(); |
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 EventTracker<TDelegate> | |
where TDelegate : class | |
{ | |
public static implicit operator TDelegate( EventTracker<TDelegate> tracker ) | |
{ | |
return tracker.Delegate; | |
} | |
public EventTracker() | |
{ |
NewerOlder