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


C# System.Test类代码示例

本文整理汇总了C#中System.Test的典型用法代码示例。如果您正苦于以下问题:C# Test类的具体用法?C# Test怎么用?C# Test使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Test类属于System命名空间,在下文中一共展示了Test类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Using

 static void Using()
 {
     using (IDisposable id = new Test())
     {
         Console.WriteLine(id);
     }
 }
开发者ID:Karapuska,项目名称:Totem,代码行数:7,代码来源:Program.cs

示例2: Visit

 public override void Visit(Test.AliquotOrder aliquotOrder)
 {
     if (aliquotOrder.TestOrderCollection.Exists(this.m_TestOrder.TestOrderId) == true)
     {
         this.m_TestOrderLeftSideIsRemoved = false;
     }
 }
开发者ID:WilliamCopland,项目名称:YPILIS,代码行数:7,代码来源:RemoveTestOrderAuditVisitor.cs

示例3: visit

 private void visit(Test test, IHierarchyVisitor visitor)
 {
     if (TestFilter(test))
     {
         visitor.Test(test);
     }
 }
开发者ID:adymitruk,项目名称:storyteller,代码行数:7,代码来源:SuiteNavigator.cs

示例4: Main3

        public static void Main3()
        {
            Test t1 = new Test()
            {
                value1 = "qoo1",
                value2 = "test2"
            };
            Test t2 = new Test()
            {
                value1 = "T2",
                value2 = "Q2",
                B1 = new byte[] { 123, 58, 69, 77, 99, 255 },
                B2 = new byte[] { 33, 44, 55, 66, 77, 88, 99, 0 }
            };
            string jsonT1 = JsonConvert.SerializeObject(t1);
            Test t11 = JsonConvert.DeserializeObject<Test>(jsonT1);
            Console.WriteLine("t1 serialize:" + jsonT1);

            string jsonT2 = JsonConvert.SerializeObject(t2);//物件內的陣列元素會被轉換成Base64字串

            string b1 = Convert.ToBase64String(t2.B1);//
            byte[] b11 = Convert.FromBase64String(b1);
            t11 = JsonConvert.DeserializeObject<Test>(jsonT2);
            Console.WriteLine("t2 serialize:" + jsonT2);
            string filePath = @"C:\MyDirectory\My.File.bat";
            string data = System.IO.Path.GetDirectoryName(filePath);
            bool isExist = Directory.Exists(data);
            //System.Web.Routing.Route router = new System.Web.Routing.Route("http://www.google.com/",)
            //IRouteHandler r ;
        }
开发者ID:knarf7112,项目名称:Proxy,代码行数:30,代码来源:Program.cs

示例5: Test03TestOnDelete

        public void Test03TestOnDelete()
        {
            dbCreated = true;
            var test = new Test
            {
                Name = "Test",
                ClientApplication = new ClientApplication
                                        {
                                            Name = "Test app",
                                            Key = Guid.NewGuid(),
                                            IsActive = true
                                        },
                IsActive = true,
                Key = "Test"
            };
            dbContext.Tests.Add(test);

            // save and refresh context
            dbContext.SaveChanges();
            dbContext.Dispose();
            var contextFactory = container.GetInstance<IDbContextFactory<HealthCheckDbContext>>();
            dbContext = contextFactory.Build();

            var beforeDelete = dbContext.Tests.Count();
            Assert.IsTrue(beforeDelete > 0, "No tests after save.");

            var test2 = dbContext.Tests.First(g => g.Id == test.Id); // reload from new context
            dbContext.Tests.Remove(test2);
            dbContext.SaveChanges();

            int afterDelete = dbContext.Tests.Count();

            Assert.AreEqual(beforeDelete - 1, afterDelete, "Tests should be deleted.");
        }
开发者ID:ChrisBriggsy,项目名称:SSW.HealthCheck,代码行数:34,代码来源:EntityFrameworkTests.cs

示例6: GetNextQuestion

 public Question GetNextQuestion(Test test, Question prevQuestion, ITestLogic logic)
 {
     this.logic = logic;
     int qId = logic.GetQuestionId(test, prevQuestion, uow);
     Question q = uow.Questions.GetById(qId);
     return q;
 }
开发者ID:nemesek,项目名称:Care,代码行数:7,代码来源:QuestionGenerator.cs

示例7: OutlineTreeBuilder

 public OutlineTreeBuilder(Test test, FixtureLibrary library, IOutlineConfigurer configurer)
 {
     var workspace = test.GetWorkspace();
     _library = library.Filter(workspace.CreateFixtureFilter().Matches);
     _test = test;
     _configurer = configurer;
 }
开发者ID:abombss,项目名称:storyteller,代码行数:7,代码来源:OutlineTreeBuilder.cs

示例8: Verify

        /// <summary>
        /// проверка ответов пользователя
        /// </summary>
        /// <param name="OriginalTest">оригинальный тест</param>
        /// <returns></returns>
        public ClientResult Verify(ref Test OriginalTest)
        {
            ClientResult res = new ClientResult();

            int ClientBalls = 0;

            foreach (ClientQuestion cq in this.Questions)
            {
                try
                {
                    QuestionBase qb = FindOriginalQuestion(cq, ref OriginalTest);
                    cq.Ball = qb.Verify(cq);
                    cq.MaxBall = qb.MaxBall;
                    cq.MinBall = qb.MinBall;
                    ClientBalls += cq.Ball;
                }
                catch
                {
                    throw new ArgumentException();
                }
            }

            res = new ClientResult(OriginalTest.MaxQuestionsBall, ClientBalls,OriginalTest.Settings);
            return res;
        }
开发者ID:BlindShot96,项目名称:tests,代码行数:30,代码来源:ClientReport.cs

示例9: AccessionOrderDataSheetDataV2

        public AccessionOrderDataSheetDataV2(Test.AccessionOrder accessionOrder, ClientOrder.Model.ClientOrderCollection clientOrderCollection, Domain.OrderCommentLogCollection orderCommentLogCollection)
        {
            this.m_AccessionOrderDataSheetDataAccessionOrder = new AccessionOrderDataSheetDataAccessionOrder(accessionOrder, clientOrderCollection);
            this.m_AccessionOrderDataSheetDataClientOrders = new List<AccessionOrderDataSheetDataClientOrder>();
            this.m_AccessionOrderDataSheetDataSpecimenOrders = new List<AccessionOrderDataSheetDataSpecimenOrder>();
            this.m_AccessionOrderDataSheetDataCommentLogs = new List<AccessionOrderDataSheetDataCommentLog>();

            foreach (Business.ClientOrder.Model.ClientOrder clientOrder in clientOrderCollection)
            {
                AccessionOrderDataSheetDataClientOrder accessionOrderDataSheetDataClientOrder = new AccessionOrderDataSheetDataClientOrder(clientOrder);
                this.m_AccessionOrderDataSheetDataClientOrders.Add(accessionOrderDataSheetDataClientOrder);
            }

            foreach (Specimen.Model.SpecimenOrder specimenOrder in accessionOrder.SpecimenOrderCollection)
            {
                AccessionOrderDataSheetDataSpecimenOrder accessionOrderDataSheetDataSpecimenOrder = new AccessionOrderDataSheetDataSpecimenOrder(specimenOrder, clientOrderCollection);
                this.m_AccessionOrderDataSheetDataSpecimenOrders.Add(accessionOrderDataSheetDataSpecimenOrder);
            }

            foreach (Domain.OrderCommentLog orderCommentLog in orderCommentLogCollection)
            {
                AccessionOrderDataSheetDataCommentLog accessionOrderDataSheetDataCommentLog = new AccessionOrderDataSheetDataCommentLog(orderCommentLog);
                this.m_AccessionOrderDataSheetDataCommentLogs.Add(accessionOrderDataSheetDataCommentLog);
            }
        }
开发者ID:ericramses,项目名称:YPILIS,代码行数:25,代码来源:AccessionOrderDataSheetDataV2.cs

示例10: switch

 private void uložitButton_Click(object sender, RoutedEventArgs e)
 {
     if (názevTextBox.Text != "" && popisTextBox.Text != "" && splnitDoDatePicker.SelectedDate != null)
     {
         int skupina;
         switch (skupinaCombobox.SelectedIndex)
         {
             case 0:
                 skupina = 1;
                 break;
             case 1:
                 skupina = 2;
                 break;
             default:
                 skupina = 0;
                 break;
         }
         Test = new Test(názevTextBox.Text, popisTextBox.Text, (předměty)Enum.Parse(typeof(předměty), ((ComboBoxItem)předmětComboBox.SelectedItem).Content.ToString()), skupina, (DateTime)splnitDoDatePicker.SelectedDate);
         this.Close();
     }
     else
     {
         MessageBox.Show("Některá z požadovaných polí nejsou vyplněna!", "Chyba", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
开发者ID:Cendrb,项目名称:UTU,代码行数:25,代码来源:TestWindow.xaml.cs

示例11: StartTest

	// Start a new test.
	public virtual void StartTest(Test test, bool isSuite)
			{
				if(!isSuite)
				{
					++numTestsRun;
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:TestResult.cs

示例12: SomethingClass

 public void SomethingClass()
 {
     var test = new Test();
     var mTest = test.ToMaybe();
     Assert.AreEqual(true, mTest.IsSomething);
     Assert.AreEqual(false, mTest.IsNothing);
 }
开发者ID:shchy,项目名称:Haskellable,代码行数:7,代码来源:MaybeTest.cs

示例13: TestFailure

 public TestFailure(Test failedTest, Exception thrownException)
 {
   base.\u002Ector();
   TestFailure testFailure = this;
   this.fFailedTest = failedTest;
   this.fThrownException = thrownException;
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:7,代码来源:TestFailure.cs

示例14: TestBasicValidationAttributeGood

 public void TestBasicValidationAttributeGood()
 {
     Test test = new Test();
     test.Property = "Testregexgood";
     Validator.Core.Validator v = new Core.Validator();
     Assert.That((Boolean)v.ValidateObject(test), Is.True);
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:7,代码来源:RegExFixture.cs

示例15: Invoke_MarshalObjectByRef_FourArg

        public void Invoke_MarshalObjectByRef_FourArg()
        {
            using (var context = AppDomainContext.Create())
            {
                var actual = new Test();
                RemoteAction.Invoke(
                    context.Domain,
                    actual,
                    (short)11,
                    new Double?(12.0),
                    new Composite() { Value = 13 },
                    (test, value2, value3, value4) =>
                    {
                        test.Value1 = 10;
                        test.Value2 = value2;
                        test.Value3 = value3;
                        test.Value4 = value4;
                    });

                Assert.IsNotNull(actual);
                Assert.AreEqual(10, actual.Value1);
                Assert.AreEqual(11, actual.Value2);
                Assert.AreEqual(12.0, actual.Value3);

                Assert.IsNotNull(actual.Value4);
                Assert.AreEqual(13, actual.Value4.Value);
            }
        }
开发者ID:NicolasDumont,项目名称:AppDomainToolkit,代码行数:28,代码来源:RemoteActionUnitTests.cs


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