public void CanInterpolateASimpleStringv2()
 {
     const string src = "Some string that is #{Replaceable}";
     const string expected = "Some string that is irreplaceable";
     var s = new Sample { Replaceable = "irreplaceable" };
     var actual = s.Interpolate(src);
     Assert.AreEqual(expected, actual);
 }
 public void CannotInterpolateIncorrectReplacer()
 {
     const string src = "Some string that is #{Replaceable";
     const string expected = "Some string that is #{Replaceable";
     var s = new Sample { Replaceable = "irreplaceable" };
     var o = (object)s;
     var actual = o.Interpolate(src);
     Assert.AreEqual(expected, actual);
 }
 public void CanInterpolateASimpleStringWithTwoProps()
 {
     const string src = "Some string that is #{Replaceable} and #{AnotherString}";
     const string expected = "Some string that is irreplaceable and more";
     var s = new Sample { Replaceable = "irreplaceable", AnotherString = "more" };
     var o = (object)s;
     var actual = o.Interpolate(src);
     Assert.AreEqual(expected, actual);
 }
 public void CanCreateASimpleListOfInterpolatables()
 {
     const string src = "Some string that is #{Replaceable}";
     var s = new Sample { Replaceable = "irreplaceable" };
     var interpolatables = s.InterpolatablesOf(src);
     Assert.IsNotNull(interpolatables);
     Assert.AreEqual(1, interpolatables.Count);
     var interpolatable = interpolatables.First();
     Assert.AreEqual("Replaceable", interpolatable.Item);
     Assert.AreEqual(InterpolatableType.Simple, interpolatable.Type);
     Assert.AreEqual(s, interpolatable.Instance);
     Assert.AreEqual("irreplaceable", interpolatable.Value);
 }
 public void CanGetSimpleValue()
 {
     const string src = "Some string that is #{Replaceable}";
     var s = new Sample { Replaceable = "irreplaceable" };
     var interpolatable = new Interpolatable<Sample>
         {
             Item = "Replaceable",
             Type = InterpolatableType.Simple,
             Instance = s
         };
     var value = interpolatable.Value;
     Assert.AreEqual("irreplaceable", value);
 }
 public void CanCreateASimpleListOfInterpolatablesWithTwoProps()
 {
     const string src = "Some string that is #{Replaceable} and #{AnotherString}";
     var s = new Sample { Replaceable = "irreplaceable", AnotherString = "more" };
     var interpolatables = s.InterpolatablesOf(src);
     Assert.IsNotNull(interpolatables);
     Assert.AreEqual(2, interpolatables.Count);
     var interpolatable1 = interpolatables.First(i => i.Item == "Replaceable");
     Assert.IsNotNull(interpolatable1);
     Assert.AreEqual(InterpolatableType.Simple, interpolatable1.Type);
     Assert.AreEqual(s, interpolatable1.Instance);
     Assert.AreEqual("irreplaceable", interpolatable1.Value);
     var interpolatable2 = interpolatables.First(i => i.Item == "AnotherString");
     Assert.IsNotNull(interpolatable2);
     Assert.AreEqual(InterpolatableType.Simple, interpolatable2.Type);
     Assert.AreEqual(s, interpolatable2.Instance);
     Assert.AreEqual("more", interpolatable2.Value);
 }