当前位置: 首页>>代码示例>>C#>>正文


C# TestModel.AddCustomer方法代码示例

本文整理汇总了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);
        }
开发者ID:NerdPad,项目名称:OrigoDB,代码行数:9,代码来源:ProxyTest.cs

示例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);
 }
开发者ID:avgx,项目名称:OrigoDB,代码行数:11,代码来源:SerializerTest.cs

示例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);
        }
开发者ID:avgx,项目名称:OrigoDB,代码行数:11,代码来源:CachingLinqCompilerTest.cs

示例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();
            }
        }
开发者ID:NerdPad,项目名称:OrigoDB,代码行数:21,代码来源:CachingLinqCompilerTest.cs

示例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();
        }
开发者ID:NerdPad,项目名称:OrigoDB,代码行数:18,代码来源:CachingLinqCompilerTest.cs

示例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();
 }
开发者ID:NerdPad,项目名称:OrigoDB,代码行数:12,代码来源:CachingLinqCompilerTest.cs


注:本文中的TestModel.AddCustomer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。