本文整理汇总了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);
}
}
示例2: Visit
public override void Visit(Test.AliquotOrder aliquotOrder)
{
if (aliquotOrder.TestOrderCollection.Exists(this.m_TestOrder.TestOrderId) == true)
{
this.m_TestOrderLeftSideIsRemoved = false;
}
}
示例3: visit
private void visit(Test test, IHierarchyVisitor visitor)
{
if (TestFilter(test))
{
visitor.Test(test);
}
}
示例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 ;
}
示例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.");
}
示例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;
}
示例7: OutlineTreeBuilder
public OutlineTreeBuilder(Test test, FixtureLibrary library, IOutlineConfigurer configurer)
{
var workspace = test.GetWorkspace();
_library = library.Filter(workspace.CreateFixtureFilter().Matches);
_test = test;
_configurer = configurer;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例11: StartTest
// Start a new test.
public virtual void StartTest(Test test, bool isSuite)
{
if(!isSuite)
{
++numTestsRun;
}
}
示例12: SomethingClass
public void SomethingClass()
{
var test = new Test();
var mTest = test.ToMaybe();
Assert.AreEqual(true, mTest.IsSomething);
Assert.AreEqual(false, mTest.IsNothing);
}
示例13: TestFailure
public TestFailure(Test failedTest, Exception thrownException)
{
base.\u002Ector();
TestFailure testFailure = this;
this.fFailedTest = failedTest;
this.fThrownException = thrownException;
}
示例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);
}
示例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);
}
}