public void use_a_runtime_converter_against_NULL() { var conversions = new Conversions(); conversions.RegisterRuntimeConversion<ColorConverter>(); var cellHandling = new CellHandling(new EquivalenceChecker(), conversions); var cell = new Cell(cellHandling, "color", typeof (Color)); var values = new StepValues("foo"); cell.ConvertValues(new Step("foo").With("color", "NULL"), values); values.Get("color").ShouldBeNull(); }
public void use_a_runtime_converter_with_a_value() { var conversions = new Conversions(); conversions.RegisterRuntimeConversion<ColorConverter>(); var cellHandling = new CellHandling(new EquivalenceChecker(), conversions); var cell = new Cell(cellHandling, "color", typeof (Color)); var values = new StepValues("foo"); cell.ConvertValues(new Step("foo").With("color", "Red"), values); var delayed = values.DelayedConversions.Single(); delayed.Key.ShouldBe("color"); delayed.Raw.ShouldBe("Red"); delayed.Converter.ShouldBeOfType<ColorConverter>(); }