本文整理汇总了C#中System.ComponentModel.MaskedTextProvider.Add方法的典型用法代码示例。如果您正苦于以下问题:C# MaskedTextProvider.Add方法的具体用法?C# MaskedTextProvider.Add怎么用?C# MaskedTextProvider.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.MaskedTextProvider
的用法示例。
在下文中一共展示了MaskedTextProvider.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add_string_int_MaskedTextResultHint_Test00001
public void Add_string_int_MaskedTextResultHint_Test00001 ()
{
MaskedTextProvider mtp;
int testPosition;
MaskedTextResultHint resultHint;
bool result;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
result = mtp.Add (@"", out testPosition, out resultHint);
Assert.AreEqual (true, result, "GenerateAdd_string_int_MaskedTextResultHint_Test#0");
Assert.AreEqual (MaskedTextResultHint.NoEffect, resultHint, "GenerateAdd_string_int_MaskedTextResultHint_Test#1");
Assert.AreEqual (1, testPosition, "GenerateAdd_string_int_MaskedTextResultHint_Test#2");
MaskedTextProviderTest.AssertProperties (mtp, "GenerateAdd_string_int_MaskedTextResultHint_Test", 3, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
}
示例2: AddStringExceptionTest1
public void AddStringExceptionTest1 ()
{
MaskedTextProvider mtp = new MaskedTextProvider ("a");
mtp.Add (null);
}
示例3: FindEditPositionInRangeTest1
public void FindEditPositionInRangeTest1 ()
{
MaskedTextProvider mtp;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 0, false), "#0");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 0, true), "#1");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 1, false), "#2");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 1, true), "#3");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 2, false), "#4");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 2, true), "#5");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 3, false), "#6");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 3, true), "#7");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 4, false), "#8");
Assert.AreEqual (0, mtp.FindEditPositionInRange (0, 4, true), "#9");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 0, false), "#10");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 0, true), "#11");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 1, false), "#12");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 1, true), "#13");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 2, false), "#14");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 2, true), "#15");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 3, false), "#16");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 3, true), "#17");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 4, false), "#18");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (1, 4, true), "#19");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 0, false), "#20");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 0, true), "#21");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 1, false), "#22");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 1, true), "#23");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 2, false), "#24");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 2, true), "#25");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 3, false), "#26");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 3, true), "#27");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 4, false), "#28");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (2, 4, true), "#29");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 0, false), "#30");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 0, true), "#31");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 1, false), "#32");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 1, true), "#33");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 2, false), "#34");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 2, true), "#35");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 3, false), "#36");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 3, true), "#37");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 4, false), "#38");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (3, 4, true), "#39");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 0, false), "#40");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 0, true), "#41");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 1, false), "#42");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 1, true), "#43");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 2, false), "#44");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 2, true), "#45");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 3, false), "#46");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 3, true), "#47");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 4, false), "#48");
Assert.AreEqual (-1, mtp.FindEditPositionInRange (4, 4, true), "#49");
MaskedTextProviderTest.AssertProperties (mtp, "FindEditPositionInRangeTest", 50, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
}
示例4: Add_string_int_MaskedTextResultHint_Test00012
public void Add_string_int_MaskedTextResultHint_Test00012 ()
{
MaskedTextProvider mtp;
int testPosition;
MaskedTextResultHint resultHint;
bool result;
//int Int32_out = 0;
//MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Remove ();
mtp.InsertAt ('\x61', 1);
result = mtp.Add (@"abc", out testPosition, out resultHint);
Assert.AreEqual (true, result, "Add_string_int_MaskedTextResultHint_Test#0");
Assert.AreEqual (MaskedTextResultHint.Success, resultHint, "Add_string_int_MaskedTextResultHint_Test#1");
Assert.AreEqual (2, testPosition, "Add_string_int_MaskedTextResultHint_Test#2");
MaskedTextProviderTest.AssertProperties (mtp, "Add_string_int_MaskedTextResultHint_Test", 3, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
}
示例5: ToString_bool_bool_int_int_Test00008
public void ToString_bool_bool_int_int_Test00008 ()
{
MaskedTextProvider mtp;
//int Int32_out = 0;
//MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Remove ();
mtp.InsertAt ('\x61', 1);
Assert.AreEqual (@"_", mtp.ToString (true, true, -1, 1), "#0");
MaskedTextProviderTest.AssertProperties (mtp, "ToString_bool_bool_int_int_Test", 1, true, false, 0, 1, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, -1, 3, @"abc", true, false, '\x0', '\x5F', true, true, true, @" bc", @" bc", @" bc", @"_bc", @"_", @" bc", @"");
}
示例6: VerifyString_string_int_MaskedTextResultHintTest00010
public void VerifyString_string_int_MaskedTextResultHintTest00010 ()
{
MaskedTextProvider mtp;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
Assert.AreEqual (false, mtp.VerifyString (@"a longer string value", out Int32_out, out MaskedTextResultHint_out), "#12");
Assert.AreEqual (MaskedTextResultHint.UnavailableEditPosition, MaskedTextResultHint_out, "#13");
Assert.AreEqual (3, Int32_out, "#14");
MaskedTextProviderTest.AssertProperties (mtp, "VerifyString_string_int_MaskedTextResultHintTest", 15, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
}
示例7: ToDisplayString
public void ToDisplayString ()
{
MaskedTextProvider mtp;
mtp = new MaskedTextProvider ("##-##");
mtp.PasswordChar = '*';
Assert.AreEqual ("__-__", mtp.ToDisplayString ());
mtp.Add ("666");
Assert.AreEqual ("**-*_", mtp.ToDisplayString ());
}
示例8: FindAssignedEditPositionInRangeTest2
public void FindAssignedEditPositionInRangeTest2 ()
{
MaskedTextProvider mtp;
//int Int32_out = 0;
//MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add ("a");
mtp.Remove ();
mtp.InsertAt ('\x61', 1);
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 0, false), "#51");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 0, true), "#52");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 1, false), "#53");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 1, true), "#54");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 2, false), "#55");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 2, true), "#56");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 3, false), "#57");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 3, true), "#58");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 4, false), "#59");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 4, true), "#60");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 0, false), "#61");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 0, true), "#62");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 1, false), "#63");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 1, true), "#64");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 2, false), "#65");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 2, true), "#66");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 3, false), "#67");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 3, true), "#68");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 4, false), "#69");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 4, true), "#70");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 0, false), "#71");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 0, true), "#72");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 1, false), "#73");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 1, true), "#74");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 2, false), "#75");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 2, true), "#76");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 3, false), "#77");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 3, true), "#78");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 4, false), "#79");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 4, true), "#80");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 0, false), "#81");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 0, true), "#82");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 1, false), "#83");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 1, true), "#84");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 2, false), "#85");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 2, true), "#86");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 3, false), "#87");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 3, true), "#88");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 4, false), "#89");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 4, true), "#90");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 0, false), "#91");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 0, true), "#92");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 1, false), "#93");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 1, true), "#94");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 2, false), "#95");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 2, true), "#96");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 3, false), "#97");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 3, true), "#98");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 4, false), "#99");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 4, true), "#100");
AssertProperties (mtp, "FindAssignedEditPositionInRangeTest", 101, true, false, 0, 1, CultureInfo.GetCultureInfo ("en-US"), 1, true, false, false, -1, 3, "abc", true, false, '\x0', '\x5F', true, true, true, @" bc", @" bc", @" bc", @"_bc", @"_", @" bc", @"");
}
示例9: FindAssignedEditPositionInRangeTest4
public void FindAssignedEditPositionInRangeTest4 ()
{
MaskedTextProvider mtp;
//int Int32_out = 0;
//MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"a?b?c");
mtp.Add ("a");
mtp.Remove ();
mtp.InsertAt ('\x61', 1);
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 0, false), "#201");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (0, 0, true), "#202");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 1, false), "#203");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 1, true), "#204");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 2, false), "#205");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 2, true), "#206");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 3, false), "#207");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 3, true), "#208");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 4, false), "#209");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 4, true), "#210");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 5, false), "#211");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 5, true), "#212");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 6, false), "#213");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (0, 6, true), "#214");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 0, false), "#215");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (1, 0, true), "#216");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 1, false), "#217");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 1, true), "#218");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 2, false), "#219");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 2, true), "#220");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 3, false), "#221");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 3, true), "#222");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 4, false), "#223");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 4, true), "#224");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 5, false), "#225");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 5, true), "#226");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 6, false), "#227");
Assert.AreEqual (1, mtp.FindAssignedEditPositionInRange (1, 6, true), "#228");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 0, false), "#229");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 0, true), "#230");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 1, false), "#231");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 1, true), "#232");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 2, false), "#233");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 2, true), "#234");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 3, false), "#235");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 3, true), "#236");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 4, false), "#237");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 4, true), "#238");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 5, false), "#239");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 5, true), "#240");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 6, false), "#241");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (2, 6, true), "#242");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 0, false), "#243");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 0, true), "#244");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 1, false), "#245");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 1, true), "#246");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 2, false), "#247");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 2, true), "#248");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 3, false), "#249");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 3, true), "#250");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 4, false), "#251");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 4, true), "#252");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 5, false), "#253");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 5, true), "#254");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 6, false), "#255");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (3, 6, true), "#256");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 0, false), "#257");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 0, true), "#258");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 1, false), "#259");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 1, true), "#260");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 2, false), "#261");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 2, true), "#262");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 3, false), "#263");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 3, true), "#264");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 4, false), "#265");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 4, true), "#266");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 5, false), "#267");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 5, true), "#268");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 6, false), "#269");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (4, 6, true), "#270");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 0, false), "#271");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 0, true), "#272");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 1, false), "#273");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 1, true), "#274");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 2, false), "#275");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 2, true), "#276");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 3, false), "#277");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 3, true), "#278");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 4, false), "#279");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 4, true), "#280");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 5, false), "#281");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 5, true), "#282");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 6, false), "#283");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (5, 6, true), "#284");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 0, false), "#285");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 0, true), "#286");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 1, false), "#287");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 1, true), "#288");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 2, false), "#289");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 2, true), "#290");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionInRange (6, 3, false), "#291");
//.........这里部分代码省略.........
示例10: FindAssignedEditPositionFromTest1
public void FindAssignedEditPositionFromTest1 ()
{
MaskedTextProvider mtp;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"abc");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (0, false), "#0");
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (0, true), "#1");
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (1, false), "#2");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionFrom (1, true), "#3");
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (2, false), "#4");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionFrom (2, true), "#5");
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (3, false), "#6");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionFrom (3, true), "#7");
Assert.AreEqual (0, mtp.FindAssignedEditPositionFrom (4, false), "#8");
Assert.AreEqual (-1, mtp.FindAssignedEditPositionFrom (4, true), "#9");
MaskedTextProviderTest.AssertProperties (mtp, "FindAssignedEditPositionFromTest", 10, true, false, 1, 0, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, 0, 3, @"abc", true, true, '\x0', '\x5F', true, true, true, @"abc", @"abc", @"abc", @"abc", @"a", @"abc", @"a");
}
示例11: MaskCompletedTest
public void MaskCompletedTest ()
{
MaskedTextProvider mtp;
string mask;
mask = @"0";
mtp = new MaskedTextProvider (mask);
Assert.IsFalse (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"9";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"#";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"L";
mtp = new MaskedTextProvider (mask);
Assert.IsFalse (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsFalse (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"?";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"&";
mtp = new MaskedTextProvider (mask);
Assert.IsFalse (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"C";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"A";
mtp = new MaskedTextProvider (mask);
Assert.IsFalse (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @"a";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @".";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @",";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
mask = @":";
mtp = new MaskedTextProvider (mask);
Assert.IsTrue (mtp.MaskCompleted, "#A" + mask);
mtp.Add ("1");
Assert.IsTrue (mtp.MaskCompleted, "#B" + mask);
mtp.Add ("a");
Assert.IsTrue (mtp.MaskCompleted, "#C" + mask);
//.........这里部分代码省略.........
示例12: Add_string_Test42871
public void Add_string_Test42871 ()
{
MaskedTextProvider mtp;
//int testPosition;
//MaskedTextResultHint resultHint;
bool result;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"$999,999.00");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
result = mtp.Add (@"€");
Assert.AreEqual (true, result, "Add_string_Test#0");
MaskedTextProviderTest.AssertProperties (mtp, "Add_string_Test", 1, true, false, 0, 8, CultureInfo.GetCultureInfo ("es-ES"), 8, true, false, false, -1, 11, @"$999,999.00", false, false, '\x0', '\x5F', true, true, true, @"€ . ,", @"€ . ,", @"€ . ,", @"€___.___,__", @"________", @"€ . ,", @"");
}
示例13: InsertAt_charTest
public void InsertAt_charTest ()
{
MaskedTextProvider mtp;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
// insert space over space
mtp = new MaskedTextProvider ("aaa");
mtp.Add (" ");
Assert.AreEqual (true, mtp.InsertAt (' ', 0, out Int32_out, out MaskedTextResultHint_out), "#A1");
Assert.AreEqual ("", mtp.ToString (), "A2");
Assert.AreEqual (0, Int32_out, "A3");
Assert.AreEqual (MaskedTextResultHint.CharacterEscaped, MaskedTextResultHint_out, "A4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_A", 1, true, false, 0, 3, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, -1, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @"", @"", @"", @"___", @"___", @"", @"");
// insert space over normal char.
mtp = new MaskedTextProvider ("aaa");
mtp.Add ("a");
Assert.AreEqual (true, mtp.InsertAt (' ', 0, out Int32_out, out MaskedTextResultHint_out), "#B1");
Assert.AreEqual (" a", mtp.ToString (), "B2");
Assert.AreEqual (0, Int32_out, "B3");
Assert.AreEqual (MaskedTextResultHint.Success, MaskedTextResultHint_out, "B4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_B", 1, true, false, 1, 2, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, 1, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @" a", @" a", @" a", @"_a_", @"_a_", @" a", @" a");
// insert space over empty position.
mtp = new MaskedTextProvider ("aaa");
Assert.AreEqual (true, mtp.InsertAt (' ', 0, out Int32_out, out MaskedTextResultHint_out), "#C1");
Assert.AreEqual ("", mtp.ToString (), "C2");
Assert.AreEqual (0, Int32_out, "C3");
Assert.AreEqual (MaskedTextResultHint.CharacterEscaped, MaskedTextResultHint_out, "C4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_C", 1, true, false, 0, 3, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, -1, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @"", @"", @"", @"___", @"___", @"", @"");
// insert space over empty position with other characters later in the string already inserted..
mtp = new MaskedTextProvider ("aaa");
mtp.InsertAt ('z', 2);
Assert.AreEqual (true, mtp.InsertAt (' ', 0, out Int32_out, out MaskedTextResultHint_out), "#D1");
Assert.AreEqual (" z", mtp.ToString (), "D2");
Assert.AreEqual (0, Int32_out, "D3");
Assert.AreEqual (MaskedTextResultHint.CharacterEscaped, MaskedTextResultHint_out, "D4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_D", 1, true, false, 1, 2, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, 2, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @" z", @" z", @" z", @"__z", @"__z", @" z", @" z");
// insert space over non-empty position with other characters later in the string already inserted..
mtp = new MaskedTextProvider ("aaa");
mtp.InsertAt ('z', 0);
mtp.InsertAt ('z', 1);
Assert.AreEqual (true, mtp.InsertAt (' ', 0, out Int32_out, out MaskedTextResultHint_out), "#E1");
Assert.AreEqual (" zz", mtp.ToString (), "E2");
Assert.AreEqual (0, Int32_out, "E3");
Assert.AreEqual (MaskedTextResultHint.Success, MaskedTextResultHint_out, "E4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_E", 1, true, false, 2, 1, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, 2, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @" zz", @" zz", @" zz", @"_zz", @"_zz", @" zz", @" zz");
// Insert number over empty position with other characters later in the string.
mtp = new MaskedTextProvider (@"aaa");
mtp.InsertAt ('\x33', 2);
Assert.AreEqual (true, mtp.InsertAt ('\x34', 0, out Int32_out, out MaskedTextResultHint_out), "#F1");
Assert.AreEqual ("4 3", mtp.ToString (), "F2");
Assert.AreEqual (0, Int32_out, "F3");
Assert.AreEqual (MaskedTextResultHint.Success, MaskedTextResultHint_out, "F4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_F", 1, true, false, 2, 1, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, 2, 3, @"aaa", true, false, '\x0', '\x5F', true, true, true, @"4 3", @"4 3", @"4 3", @"4_3", @"4_3", @"4 3", @"4 3");
// insert space over literal with filled in positions later on (no more available edit positions)
mtp = new MaskedTextProvider ("aba");
mtp.InsertAt ('z', 0);
mtp.InsertAt ('z', 1);
mtp.InsertAt ('z', 2);
Assert.AreEqual (false, mtp.InsertAt (' ', 1, out Int32_out, out MaskedTextResultHint_out), "#F1");
Assert.AreEqual ("zbz", mtp.ToString (), "F2");
Assert.AreEqual (3, Int32_out, "F3");
Assert.AreEqual (MaskedTextResultHint.UnavailableEditPosition, MaskedTextResultHint_out, "F4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_F", 1, true, false, 2, 0, CultureInfo.GetCultureInfo ("es-ES"), 2, true, false, false, 2, 3, @"aba", true, true, '\x0', '\x5F', true, true, true, @"zbz", @"zbz", @"zbz", @"zbz", @"zz", @"zbz", @"zz");
// insert space over literal with filled in positions later on ( more available edit positions)
mtp = new MaskedTextProvider ("abaa");
mtp.InsertAt ('z', 0);
mtp.InsertAt ('z', 2);
Assert.AreEqual (true, mtp.InsertAt (' ', 1, out Int32_out, out MaskedTextResultHint_out), "#G1");
Assert.AreEqual ("zb z", mtp.ToString (), "G2");
Assert.AreEqual (2, Int32_out, "G3");
Assert.AreEqual (MaskedTextResultHint.Success, MaskedTextResultHint_out, "G4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_G", 1, true, false, 2, 1, CultureInfo.GetCultureInfo ("es-ES"), 3, true, false, false, 3, 4, @"abaa", true, false, '\x0', '\x5F', true, true, true, @"zb z", @"zb z", @"zb z", @"zb_z", @"z_z", @"zb z", @"z z");
// insert space over literal with only more literals later on
mtp = new MaskedTextProvider ("abb");
Assert.AreEqual (false, mtp.InsertAt (' ', 1, out Int32_out, out MaskedTextResultHint_out), "#G1");
Assert.AreEqual (" bb", mtp.ToString (), "G2");
Assert.AreEqual (3, Int32_out, "G3");
Assert.AreEqual (MaskedTextResultHint.UnavailableEditPosition, MaskedTextResultHint_out, "G4");
MaskedTextProviderTest.AssertProperties (mtp, "InsertAt_charTest_G", 1, true, false, 0, 1, CultureInfo.GetCultureInfo ("es-ES"), 1, true, false, false, -1, 3, @"abb", true, false, '\x0', '\x5F', true, true, true, @" bb", @" bb", @" bb", @"_bb", @"_", @" bb", @"");
}
示例14: AddStringExceptionTest2
public void AddStringExceptionTest2 ()
{
MaskedTextProvider mtp = new MaskedTextProvider ("a");
int tp;
MaskedTextResultHint rh;
mtp.Add (null, out tp, out rh);
}
示例15: VerifyCharTest01186
public void VerifyCharTest01186 ()
{
MaskedTextProvider mtp;
int Int32_out = 0;
MaskedTextResultHint MaskedTextResultHint_out = MaskedTextResultHint.Unknown;
mtp = new MaskedTextProvider (@"09#L?&CAa.,:/$<>|\\");
mtp.Add (@"a");
mtp.Add ('\x61');
mtp.Add ('\x61', out Int32_out, out MaskedTextResultHint_out);
Assert.AreEqual (true, mtp.VerifyChar ('\x2F', 12, out MaskedTextResultHint_out), "#0");
Assert.AreEqual (MaskedTextResultHint.CharacterEscaped, MaskedTextResultHint_out, "#1");
MaskedTextProviderTest.AssertProperties (mtp, "VerifyCharTest", 2, true, false, 0, 9, CultureInfo.GetCultureInfo ("es-ES"), 9, true, false, false, -1, 15, @"09#L?&CAa.,:/$<>|\\", false, false, '\x0', '\x5F', true, true, true, @" ,.:/€\", @" ,.:/€\", @" ,.:/€\", @"_________,.:/€\", @"_________", @" ,.:/€\", @"");
}