This file contains 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 ViewModelField<T> : INotifyPropertyChanged | |
{ | |
private T _value; | |
public T Value | |
{ | |
get { return _value; } | |
set | |
{ | |
_value = value; | |
PropertyChanged(this, new PropertyChangedEventArgs("Value")); |
This file contains 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 'rake' | |
require './transform_mspec_report' | |
desc "Done..." | |
task :default => [:mspec, :transform] do | |
puts "Done..." | |
end | |
desc "Generate MSpec test report." | |
task :mspec do |
This file contains 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 "nokogiri" | |
class TransformMSpecReport | |
def self.transform() | |
doc = Nokogiri::XML(File.read('test_result.xml')) | |
xslt = Nokogiri::XSLT(File.read('mSpec2JUnit.xslt')) | |
doc = xslt.transform(doc) | |
File.open('test_result_junit.xml', 'w') {|f| f.write(doc) } | |
puts "File transformed." | |
end |
This file contains 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.Reactive.Linq; | |
using Minimod.MessageProcessor; | |
using Minimod.ZeroMqMessageStream; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains 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
var sut = Observable.Start(() => | |
{ | |
return "Demo"; | |
}); | |
var testScheduler = new Microsoft.Reactive.Testing.TestScheduler(); | |
var actual = testScheduler.Start(() => sut); | |
Microsoft.Reactive.Testing.ReactiveAssert.AreElementsEqual(actual.Messages, new[] { | |
new Recorded<Notification<string>>(200, Notification.CreateOnNext("Demo")), |
This file contains 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
var step = require("step"); | |
var weasel1 = function(callback) { | |
callback(null, 'first'); | |
} | |
var weasel2 = function(callback) { | |
callback(null, 'second'); | |
} |
This file contains 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
var expected = new long[] {0, 1, 2, 3, 4}; | |
var actual = new List<long>(); | |
var scheduler = new TestScheduler(); | |
var interval = Observable.Interval(TimeSpan.FromSeconds(1), scheduler).Take(5); | |
interval.Subscribe(actual.Add); | |
scheduler.Start(); | |
CollectionAssert.AreEqual(expected, actual); |
This file contains 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 SharedResource : IDisposable | |
{ | |
public int SequenceNumber { get; private set; } | |
public SharedResource() | |
{ | |
Debug.WriteLine("SharedResource created."); | |
} | |
public void Increment() |
This file contains 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 LRUObservableCollection<T> : ObservableCollection<T> | |
{ | |
private readonly int _length; | |
public LRUObservableCollection(int length) | |
{ | |
_length = length; | |
} | |
protected override void InsertItem(int index, T item) |
This file contains 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
/* empty */ |