本文整理汇总了C#中TestModel.AddCustomer方法的典型用法代码示例。如果您正苦于以下问题:C# TestModel.AddCustomer方法的具体用法?C# TestModel.AddCustomer怎么用?C# TestModel.AddCustomer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestModel
的用法示例。
在下文中一共展示了TestModel.AddCustomer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanCloneMarshalByRefModel
public void CanCloneMarshalByRefModel()
{
var model = new TestModel();
model.AddCustomer("Zippy");
var clone = new BinaryFormatter().Clone(model);
model.AddCustomer("asfafse");
Assert.IsTrue(clone.Customers.Count() == 1);
}
示例2: SizeOf_reports_actual_size
public void SizeOf_reports_actual_size()
{
IFormatter target = new BinaryFormatter();
var testModel = new TestModel();
testModel.AddCustomer("Homer");
testModel.AddCustomer("Bart");
long actual = target.SizeOf(testModel);
long expected = target.ToByteArray(testModel).Length;
Trace.WriteLine("SizeOf(TestModel with 2 customers) using BinaryFormatter = " + expected);
Assert.AreEqual(expected, actual);
}
示例3: CanExecuteFirstCustomerStartingWithArg0
public void CanExecuteFirstCustomerStartingWithArg0()
{
var expected = "Homer Simpson";
var query = FirstCustomersNameStartingWithArg0;
var model = new TestModel();
model.AddCustomer(expected);
Engine<TestModel> engine = Engine.Create(model, Config());
string actual = engine.Execute<TestModel, string>(query, "Ho");
Assert.AreEqual(expected, actual);
}
示例4: ExecutionFailsForMismatchedArgumentTypeOnSecondInvocation
public void ExecutionFailsForMismatchedArgumentTypeOnSecondInvocation()
{
Engine<TestModel> engine = null;
try
{
var args = new object[] { "H" };
var model = new TestModel();
model.AddCustomer("Homer Simpson");
engine = Engine.Create(model, CreateConfig());
engine.Execute(FirstCustomersNameStartingWithArg0, args);
args[0] = 42; //boxed int
//cached query generated code casts args[0] to string. should throw
engine.Execute(FirstCustomersNameStartingWithArg0, args);
}
finally
{
if (engine != null) engine.Close();
}
}
示例5: CanExecuteQueryWithNewDifferentParameters
public void CanExecuteQueryWithNewDifferentParameters()
{
string expected0 = "Homer Simpson";
string expected1 = "Robert Friberg";
var query = allQueries[0];
var model = new TestModel();
model.AddCustomer(expected0);
model.AddCustomer(expected1);
Engine<TestModel> engine = Engine.Create(model, CreateConfig());
string actual = engine.Execute<TestModel, string>(query, "Ho");
Assert.AreEqual(expected0, actual);
actual = (string)engine.Execute(query, "Ro");
Assert.AreEqual(actual, expected1);
engine.Close();
}
示例6: CanExecuteListQuery
public void CanExecuteListQuery()
{
var model = new TestModel();
model.AddCustomer("Zippy");
model.AddCustomer("Droozy");
var engine = Engine.Create(model, CreateConfig());
var list = engine.Execute<TestModel, List<string>>(ListOfCustomerNames);
Assert.AreEqual(list.Count, 2);
Assert.AreEqual(list[0], "Zippy");
Assert.AreEqual(list[1], "Droozy");
engine.Close();
}