View DisplayNameByResourceKeyAttribute.cs
public class DisplayNameByResourceKeyAttribute : DisplayNameAttribute | |
{ | |
public DisplayNameByResourceKeyAttribute(string resourceKey) | |
{ | |
DisplayNameValue = DisplayNameByResourceKey(resourceKey) ?? resourceKey; | |
} | |
private static string DisplayNameByResourceKey(string value) | |
{ | |
return null; |
View Rx_Observer_Observables.cs
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication3 | |
{ | |
class Program2 | |
{ |
View Rx_FizzBuzz.cs
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication4 | |
{ | |
class Program | |
{ |
View CodeKataPickAkin.cs
/* | |
http://ilker.de/code-kata-pickakin | |
akinList = [A1,B2,A2,A3,B3,A4,D1,D2,B1] | |
ceoList = [C1,E1,E2] | |
controlList = [F1] | |
*/ | |
var ceoListOriginal = new List<string>() {"A1", "B1", "A2", "A3", "C1", "D1", "E1", "E2"}; |
View ViewModelField.cs
public class ViewModelField<T> : INotifyPropertyChanged | |
{ | |
private T _value; | |
public T Value | |
{ | |
get { return _value; } | |
set | |
{ | |
_value = value; | |
PropertyChanged(this, new PropertyChangedEventArgs("Value")); |
View rakefile.rb
require 'rake' | |
require './transform_mspec_report' | |
desc "Done..." | |
task :default => [:mspec, :transform] do | |
puts "Done..." | |
end | |
desc "Generate MSpec test report." | |
task :mspec do |
View transform_mspec_report.rb
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 |
View mSpec2JUnit.xslt
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" indent="yes"/> | |
<xsl:variable name="specs" select="//specification"/> | |
<xsl:template match="MSpec"> | |
<testsuite | |
name="Specifications" | |
tests="{count($specs)}" | |
errors="0" |
View ZeroMqDocumentSaga.cs
using System; | |
using System.Reactive.Linq; | |
using Minimod.MessageProcessor; | |
using Minimod.ZeroMqMessageStream; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
View rx-test
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")), |
OlderNewer