本文整理汇总了C#中Test类的典型用法代码示例。如果您正苦于以下问题:C# Test类的具体用法?C# Test怎么用?C# Test使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Test类属于命名空间,在下文中一共展示了Test类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main()
{
Test test = new Test();
test.SetValue(3,5);
int s = test.GetValue();
Console.WriteLine("<<< " + s);
}
开发者ID:Tob1112,项目名称:seungbeomi,代码行数:7,代码来源:Hello.cs
示例2: AsyncHTTPSICmd
public void AsyncHTTPSICmd()
{
FileStream stream;
stream = File.Create(outputFileHTTPSAsync);
results = new StreamWriter(stream);
System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
ICmd validICmd = new ICmd(TestGlobals.testServer, TestGlobals.validSerial);
Test validTest = new Test(validICmd);
validTest.setTestName("ValidSerial");
validTest.setExpectedResult ("200");
validTest.setType ("performance");
List<Test> tests = new List<Test>();
tests.Add(validTest);
// Construct started tasks
Task<double>[] tasks = new Task<double>[TestGlobals.maxReps];
for (int i = 0; i < TestGlobals.maxReps; i++)
{
System.Threading.Thread.Sleep(TestGlobals.delay);
tasks[i] = new HTTPSCalls().runTest(validTest, HTTPOperation.GET);
Console.WriteLine("Test starting:" + i.ToString());
}
Console.WriteLine("------------------------------------------------------");
Console.WriteLine("All tests initialized, waiting on them to run as async");
Console.WriteLine("------------------------------------------------------");
Task.WaitAll(tasks);
foreach (Task<double> nextResult in tasks)
{
results.WriteLine("Test Time," + nextResult.Result);
}
results.Close();
}
开发者ID:Cozumo,项目名称:InterceptorDemoScan,代码行数:35,代码来源:ICmdPerformanceTest.cs
示例3: AddTest
//**********************Test Messages***********************************
public ActionResult AddTest(int pid)
{
ViewData["PatientId"] = pid;
populateTestNames();
var testmsg = new Test { TestDate = DateTime.UtcNow };
return View(testmsg);
}
开发者ID:aliken9,项目名称:ic2012,代码行数:8,代码来源:TreatmentPlannerController.cs
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Test test=new Test();
DataTable table = test.Adomd();
GridView1.DataSource = table;
GridView1.DataBind();
}
开发者ID:scalzdp,项目名称:studydoc,代码行数:7,代码来源:WebForm2.aspx.cs
示例5: TestClassMap
public void TestClassMap()
{
// this test passes normally when the Test class is automapped
// uncomment all or parts of the class map initialization code to test
// the exceptions thrown for each non-compliant field or property
if (__firstTime)
{
BsonClassMap.RegisterClassMap<Test>(cm =>
{
cm.AutoMap();
// cm.MapField("literal");
// cm.MapField("readOnly");
// cm.MapField("notfound");
// cm.MapProperty("GetOnly");
// cm.MapProperty("SetOnly");
// cm.MapProperty("notfound");
// cm.MapMember(null);
});
__firstTime = false;
}
var test = new Test("x") { SetOnly = "y" };
var bson = test.ToBson();
var rehydrated = BsonSerializer.Deserialize<Test>(bson);
Assert.IsTrue(bson.SequenceEqual(rehydrated.ToBson()));
}
开发者ID:GGsus,项目名称:mongo-csharp-driver,代码行数:27,代码来源:CSharp104Tests.cs
示例6: IgnoreTestForBrowser
private bool IgnoreTestForBrowser(Test test, MemberInfo member)
{
bool ignoreTest = false;
Attribute[] ignoreAttr = Reflect.GetAttributes(member, IgnoreBrowserAttributeTypeFullName, true);
if (member != null && ignoreAttr != null)
{
// A test case might be ignored in more than one browser
foreach (System.Attribute attr in ignoreAttr)
{
object propVal = Reflect.GetPropertyValue(attr, "Value", BindingFlags.Public | BindingFlags.Instance);
object reasonValue = Reflect.GetPropertyValue(attr, "Reason", BindingFlags.Public | BindingFlags.Instance);
if (propVal != null)
{
string ignoreReason = "Ignoring browser " + EnvironmentManager.Instance.Browser.ToString() + ".";
if (reasonValue != null)
{
ignoreReason = ignoreReason + " " + reasonValue.ToString();
}
Browser browser = (Browser)propVal;
if (browser.Equals(EnvironmentManager.Instance.Browser) || browser.Equals(Browser.All) || IsRemoteInstanceOfBrowser(browser))
{
ignoreTest = true;
}
}
}
}
return ignoreTest;
}
开发者ID:v4viveksharma90,项目名称:selenium,代码行数:33,代码来源:WebDriverTestDecorator.cs
示例7: Run
public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
{
DDS.IDomainParticipant participant;
DDS.SubscriberQos subscriberQosHolder = null;
DDS.ISubscriber subscriber;
Test.Framework.TestResult result;
DDS.ITopic topic;
participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
topic = (DDS.ITopic)testCase.ResolveObject("topic");
result = new Test.Framework.TestResult("Initialization success", string.Empty, Test.Framework.TestVerdict.Pass,
Test.Framework.TestVerdict.Fail);
if (participant == null || topic == null)
{
System.Console.Error.WriteLine("participant or topic = null");
result.Result = "precondition not met";
return result;
}
if (participant.GetDefaultSubscriberQos(ref subscriberQosHolder) != DDS.ReturnCode.Ok)
{
result.Result = "could not get default SubscriberQos";
return result;
}
subscriber = participant.CreateSubscriber(subscriberQosHolder);//, null, DDS.StatusKind.Any);
if (subscriber == null)
{
result.Result = "could create a Subscriber";
return result;
}
testCase.RegisterObject("subscriber", subscriber);
result.Result = "Initialization success.";
result.Verdict = Test.Framework.TestVerdict.Pass;
return result;
}
开发者ID:shizhexu,项目名称:opensplice,代码行数:34,代码来源:DomainParticipantItem2Init.cs
示例8: pictureBox2_Click
private void pictureBox2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
textBox1.Clear();
MessageBox.Show("Nama harus diisi", "WARNING!!!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
data dat = new data(textBox1.Text);
db.OpenConn();
try
{
string sql = string.Concat("INSERT INTO Users " + "([nama]) VALUES " + "('"+textBox1.Text+"')");
db.execQuery(sql);
//MessageBox.Show("Nama Add Sukses");
Test tst = new Test();
this.Close();
tst.Show();
data.cektestbuttonabout = false;
data.cektestbuttoninfo = false;
}
catch (Exception)
{
//MessageBox.Show("Data tidak dimasukkan");
}
db.CloseConn();
}
}
开发者ID:godofknife,项目名称:SPB,代码行数:30,代码来源:input.cs
示例9: Main
private static int Main()
{
Test test = new Test(20.0d);
test.Print();
Console.WriteLine("*** PASSED ***");
return 100;
}
开发者ID:CheneyWu,项目名称:coreclr,代码行数:7,代码来源:instance.cs
示例10: Main
static void Main()
{
Test test = new Test();
test.Changed = new MyMessage();
test.No = 10;
test.No = 50;
}
开发者ID:NituThakkar,项目名称:ajay,代码行数:7,代码来源:Program.cs
示例11: SerializeToXmlDocument_TestModel_ReturnsXmlDocument
public void SerializeToXmlDocument_TestModel_ReturnsXmlDocument()
{
var model = new Test { Name = "John Doe", Birth = new DateTime(1950, 1, 1) };
var document = XmlHelper.SerializeToXmlDocument(model);
Assert.IsNotNull(document);
Assert.AreEqual("John Doe", document.DocumentElement.FirstChild.FirstChild.Value);
}
开发者ID:rodpl,项目名称:Four2n.Commons,代码行数:7,代码来源:XmlHelperTests.cs
示例12: Main
public static int Main()
{
Test staticsTest = new Test();
staticsTest.RunTest();
Console.WriteLine(100 == staticsTest.retVal ? "Test Passed":"Test Failed");
return staticsTest.retVal;
}
开发者ID:l1183479157,项目名称:coreclr,代码行数:7,代码来源:ThreadStatic03.cs
示例13: Post
public IHttpActionResult Post(Test test)
{
this.studentDataManagement.Tests.Add(test);
this.studentDataManagement.SaveChanges();
return this.Ok("New Test added");
}
开发者ID:viktorD1m1trov,项目名称:T-Academy,代码行数:7,代码来源:TestsController.cs
示例14: PutTest
public IHttpActionResult PutTest(int id, Test test)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != test.Id)
{
return BadRequest();
}
db.Entry(test).State = EntityState.Modified;
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException)
{
if (!TestExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
开发者ID:govhack-healthbuddy,项目名称:Healthbuddy.Api,代码行数:32,代码来源:TestsController.cs
示例15: test_Click
private void test_Click(object sender, EventArgs e)
{
this.Hide();
Test test = new Test(this);
test.SetDesktopLocation(this.DesktopLocation.X, this.DesktopLocation.Y);
test.Show();
}
开发者ID:cbzfy6188,项目名称:MyEnglish,代码行数:7,代码来源:Main.cs
示例16: Main
unsafe static void Main()
{
Test test = new Test();
Test* p = &test;
p->x = 9;
System.Console.WriteLine (test.x);
}
开发者ID:ppatoria,项目名称:SoftwareDevelopment,代码行数:7,代码来源:unsafe1.cs
示例17: Main
static int Main()
{
Test t = new Test();
t.RunTest();
return t.CheckRet();
}
开发者ID:CheneyWu,项目名称:coreclr,代码行数:7,代码来源:semdemo.cs
示例18: Main
static void Main(string[] args)
{
var test = new Test();
test.Start();
Console.ReadKey();
}
开发者ID:AlexShkorParalect,项目名称:TeamCitySharper,代码行数:7,代码来源:Program.cs
示例19: Run
public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
{
DDS.IDomainParticipant participant;
mod.tstTypeSupport typeSupport;
DDS.TopicQos topicQos;
DDS.ITopic topic;
DDS.ReturnCode rc;
Test.Framework.TestResult result;
participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
typeSupport = (mod.tstTypeSupport)testCase.ResolveObject("typeSupport");
topicQos = (DDS.TopicQos)testCase.ResolveObject("topicQos");
result = new Test.Framework.TestResult("Initialization 3 success", string.Empty,
Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Fail);
rc = typeSupport.RegisterType(participant, "my_other_type");
if (rc != DDS.ReturnCode.Ok)
{
result.Result = "Register type failed.";
return result;
}
topic = participant.CreateTopic("my_other_topic", "my_other_type", topicQos);//, null, 0);
if (topic == null)
{
result.Result = "Topic could not be created.";
return result;
}
testCase.RegisterObject("otherTopic", topic);
result.Result = "Initialization success.";
result.Verdict = Test.Framework.TestVerdict.Pass;
return result;
}
开发者ID:shizhexu,项目名称:opensplice,代码行数:30,代码来源:SubscriberItem3Init.cs
示例20: ExtentTest
/// <summary>
/// Creates a test node as a top-most level test
/// </summary>
///
/// <param name="Name">Test name</param>
/// <param name="Description">A short description of the test</param>
public ExtentTest(string Name, string Description)
{
_test = new Test();
_test.Name = Name;
_test.Description = Description;
}
开发者ID:bharathsannadi,项目名称:extentreports,代码行数:13,代码来源:ExtentTest.cs
注:本文中的Test类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论