public void TestFirstGuidConversionSuccess() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "9D2B0228-4D0D-4C23-8B49-01A698857709" } } }; Assert.AreEqual(new Guid("9D2B0228-4D0D-4C23-8B49-01A698857709"), parameter.First<Guid>()); }
public void TestFirstGuidConversionFailed() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "Invalid" } } }; Assert.AreEqual(default(Guid), parameter.First<Guid>()); }
public void TestFirstDateTimeConversionSuccess() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "2014-04-14 13:50:59" } } }; Assert.AreEqual(DateTime.Parse("2014-04-14 13:50:59"), parameter.First<DateTime>()); }
public void TestFirstEnumConversionSuccess() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "Six" } } }; Assert.AreEqual(ExecutableEnum.Six, parameter.First<ExecutableEnum>()); }
public void TestFirstKnownTypeSuccess() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "1", "Anything", "Nothing" } } }; Assert.AreEqual("1", parameter.First<String>(false)); }
public void TestFirstIntegerConversionSuccess() { var parameter = new CommandParameter() { Data = { Content = new List<String>() { "1" } } }; Assert.AreEqual(1, parameter.First<int>()); }