本文整理汇总了C#中TestType类的典型用法代码示例。如果您正苦于以下问题:C# TestType类的具体用法?C# TestType怎么用?C# TestType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestType类属于命名空间,在下文中一共展示了TestType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Update_Should_Update_A_TestType
public void Update_Should_Update_A_TestType()
{
_repository
.Setup(it => it.Update(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<Boolean>(), It.IsAny<Int32>()))
.Callback<String, String, Boolean, Int32>((name, testValidatorType, isActive, id) =>
{
var tTestType = _repositoryList.Find(x => x.Id==id);
tTestType.Name = name;
tTestType.TestValidatorType = testValidatorType;
tTestType.IsActive = isActive;
});
var tempTestType = _repositoryList.Find(x => x.Id==id);
var testTestType = new TestType {
Id = tempTestType.Id,
Name = tempTestType.Name,
TestValidatorType = tempTestType.TestValidatorType,
IsActive = tempTestType.IsActive};
//TODO change something on testTestType
//testTestType.oldValue = newValue;
_target.Update(testTestType);
//Assert.AreEqual(newValue, _repositoryList.Find(x => x.Id==1).oldValue);
//TODO fail until we update the test above
Assert.Fail();
}
开发者ID:leloulight,项目名称:LucentDb,代码行数:25,代码来源:TestTypeWebAPITest.cs
示例2: ShowAbstractFactory
public void ShowAbstractFactory()
{
TestType tt = new TestType();
ISomething sm = SomethingFactory.CreateSomething();
sm.InsertSomething(tt);
sm.GetSomething("1234");
}
开发者ID:dearz,项目名称:Practice,代码行数:7,代码来源:MainForm.cs
示例3: TestResults
public TestResults( int totalRes, int correctRes, DateTime timeOfPassage, TestType type)
{
TotalRes = totalRes;
CorrectRes = correctRes;
TimeOfPassage = timeOfPassage;
Type = type;
}
开发者ID:Karoliner,项目名称:english_teaching_app,代码行数:7,代码来源:Lib.cs
示例4: RunTest
public static void RunTest(TestType type, int ThreadCount, CallbackFunction callBack, ITest target)
{
for (int i = 0; i < ThreadCount; i++)
{
BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += (object sender, DoWorkEventArgs e) =>
{
bool result = target.Test();
e.Result = result;
};
worker.RunWorkerCompleted += (object sender, RunWorkerCompletedEventArgs e) =>
{
if (callBack != null)
{
if (e.Error != null)
{
callBack(type, (bool)e.Result);
}
else
{
callBack(type, false);
}
}
};
worker.RunWorkerAsync();
}
}
开发者ID:shakasi,项目名称:shakasi.github.com,代码行数:29,代码来源:Utility.cs
示例5: AddHandlerWorks
public void AddHandlerWorks() {
bool invoked = false;
var c = new TestType();
Type.AddHandler(c, "Evt", (EventHandler)((s, e) => invoked = true));
c.Raise();
Assert.AreEqual(invoked, true);
}
开发者ID:pdavis68,项目名称:SaltarelleCompiler,代码行数:7,代码来源:TypeUtilityMethodsTests.cs
示例6: Clear
// public Dictionary<string, List<string>> MatchedSurfaceIds;
// public Dictionary<string, List<string>> MatchedOpening;
public void Clear()
{
testSummary = "";
testReasoning = "";
if (standResult != null)
standResult.Clear();
if (testResult != null)
testResult.Clear();
if (idList != null)
idList.Clear();
tolerance = DOEgbXMLBasics.Tolerances.ToleranceDefault;
lengthtol = DOEgbXMLBasics.Tolerances.ToleranceDefault;
vectorangletol = DOEgbXMLBasics.Tolerances.ToleranceDefault;
coordtol = DOEgbXMLBasics.Tolerances.ToleranceDefault;
testType = TestType.None;
subTestIndex = -1;
passOrFail = false;
if (MessageList != null) { MessageList.Clear(); }
if (TestPassedDict != null) { TestPassedDict.Clear(); }
longMsg = "";
}
开发者ID:Carmelsoft,项目名称:ValidatorPhase1,代码行数:28,代码来源:DOEgbXMLReportingObj.cs
示例7: RunTest
public static TestResult RunTest(TestType testType)
{
const int repeat = 5;
var spaces = new[]
{
new Space(1000, 1000),
new Space(1200, 1200),
new Space(1400, 1400),
new Space(1600, 1600),
new Space(1800, 1800),
new Space(2000, 2000)
};
var watch = new Stopwatch();
var testResult = new TestResult();
foreach (var space in spaces)
{
space.RandomGenerate();
var key = $"{space.HeightCount}x{space.WidthCount}";
for (var i = 0; i < repeat; i++)
{
watch.Start();
switch (testType)
{
case TestType.SingleThread:
space.NewGeneration();
break;
case TestType.MultiThread:
space.NewGenerationMultiThread();
break;
default:
throw new ArgumentOutOfRangeException(nameof(testType), testType, null);
}
watch.Stop();
testResult[key] = watch.ElapsedMilliseconds;
watch.Reset();
}
var eventArg = new IntermediateResult
{
TestType = testType,
Min = testResult[key, GettingType.Min],
Max = testResult[key, GettingType.Max],
Size = key
};
NewGenerationDone?.Invoke(null, eventArg);
}
return testResult;
}
开发者ID:sunriselink,项目名称:GameLife,代码行数:59,代码来源:Performance.cs
示例8: ProcessAsync
public override async Task ProcessAsync(ILiaraContext context)
{
// Anything put into content will be serialized into the stream, using the Formatter,
// which is in-turn automatically selected using the FormatSelector.
var t = new TestType {Message = "Hello!", RequestPath = context.Request.Info.Uri.ToString()};
context.Response.Content = t;
await base.ProcessAsync(context);
}
开发者ID:prasannavl,项目名称:Liara,代码行数:9,代码来源:Program.cs
示例9: RevitLookupTestFuncInfo
public RevitLookupTestFuncInfo(string label, string desc, System.Type classType, TestFunc func, TestType tType)
{
m_label = label;
m_desc = desc;
m_classType = classType;
m_isCategoryBased = false;
m_testFunc = func;
m_testType = tType;
}
开发者ID:halad,项目名称:RevitLookup,代码行数:9,代码来源:RvtMgdDbgTestFuncInfo.cs
示例10: Big_long_expressions_work
public void Big_long_expressions_work(TestState testState, TestType testType, string expected)
{
var actual = _queryStringBuilder
.QueryStringWith(testState == TestState.All ? "" : "state=" + testState.ToString().EnumNameToTransportCase())
.AndWith(testType == TestType.All ? "" : "type=" + testType.ToString().EnumNameToTransportCase())
.Build();
actual.Should().Be(expected);
}
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:9,代码来源:QueryBuilderTest.cs
示例11: with_a_non_typed_option_that_does_not_exist_should_not_set
public void with_a_non_typed_option_that_does_not_exist_should_not_set()
{
var referenceType = new TestType();
var result = OptionApplicator.Get<TestType>(new OptionSource[]{
new OptionSource("test", "NonExistent", false, "bar")
});
Assert.AreEqual(referenceType.Flag, result.Flag);
Assert.AreEqual(referenceType.IpEndpoint, result.IpEndpoint);
Assert.AreEqual(referenceType.Name, result.Name);
}
开发者ID:danieldeb,项目名称:EventStore,代码行数:10,代码来源:when_option_applicator_get.cs
示例12: TestMethodWrapperContainer
/// <summary>
/// Initializes a new instance of the <see cref="TestMethodWrapperContainer"/> class.
/// </summary>
/// <param name="testMethodsWrapper">The test methods wrapper.</param>
/// <param name="groupingField">The grouping field.</param>
internal TestMethodWrapperContainer(string caption, IEnumerable<TestMethodWrapper> testMethodsWrapper, TestMethodGroupingField groupingField, TestType testType)
{
_caption = caption;
_groupingField = groupingField;
TestType = testType;
TestMethodsWrapper = testMethodsWrapper;
LazyLoading = true;
}
开发者ID:pkelbern,项目名称:OpenCover.UI,代码行数:15,代码来源:TestMethodWrapperContainer.cs
示例13: Edit
public ActionResult Edit(int id, TestType testType)
{
try
{
_dbTestTypeRepository.Update(testType);
return RedirectToAction("Index");
}
catch
{
return View(testType);
}
}
开发者ID:leloulight,项目名称:LucentDb,代码行数:12,代码来源:TestTypeController.cs
示例14: Create
public ActionResult Create(TestType testType)
{
try
{
_dbTestTypeRepository.Insert(testType);
return RedirectToAction("Index");
}
catch
{
return View(testType);
}
}
开发者ID:leloulight,项目名称:LucentDb,代码行数:12,代码来源:TestTypeController.cs
示例15: ItShouldReturnFalseIfInnerSpecificationReturnsTrue
public void ItShouldReturnFalseIfInnerSpecificationReturnsTrue(IFixture fixture, [Frozen]ISpecification<TestType> inner, TestType item)
{
// Arrange
A.CallTo(() => inner.IsSatisfiedBy(item)).Returns(true);
var sut = fixture.Create<NotSpecification<TestType>>();
// Act
var result = sut.IsSatisfiedBy(item);
// Assert
result.Should().BeFalse();
}
开发者ID:ChristopherWolf,项目名称:DSLFun,代码行数:13,代码来源:NotSpecificationTests.cs
示例16: Then_the_cache_item_is_automatically_recalculated_according_to_the_strategy
public void Then_the_cache_item_is_automatically_recalculated_according_to_the_strategy()
{
//arrange / act
var instance = new TestType();
var result = instance.MyMethod3();
//assert
Assert.That(result == 1);
Thread.Sleep(TimeSpan.FromSeconds(5)); //wait for auto recalculation to be performed
//assert
Assert.That(TestType.Counter > 1); //the method has been invoked automatically behind the scenes a number of times by a worker thread
}
开发者ID:benaston,项目名称:NCacheFacade,代码行数:14,代码来源:CacheAspectTests.cs
示例17: Then_the_return_value_is_from_the_cache_when_the_key_is_present
public void Then_the_return_value_is_from_the_cache_when_the_key_is_present()
{
//arrange / act
var result1 = new TestType().MyMethod1();
//assert
Assert.That(result1 == 2);
//arrange / act
var result2 = new TestType().MyMethod2(3, "test string");
//assert
Assert.That(result2 == 2);
}
开发者ID:benaston,项目名称:NCacheFacade,代码行数:14,代码来源:CacheAspectTests.cs
示例18: Then_the_result_is_recalculated_as_if_no_caching_was_in_place
public void Then_the_result_is_recalculated_as_if_no_caching_was_in_place()
{
//arrange / act
var instance = new TestType();
var result = instance.MyMethod4();
//assert
Assert.That(result == 1);
//arrange / act
instance.MyMethod4();
//assert
Assert.That(TestType.Counter2 == 3); //the counter has been manually incremented once for each of the direct invocations, with one automatic calculation ocurring in the meantime
}
开发者ID:benaston,项目名称:NCacheFacade,代码行数:15,代码来源:CacheAspectTests.cs
示例19: SimpleObjectRoundTrip
public void SimpleObjectRoundTrip()
{
var serializer = new SSJsonSerializer();
var testObj = new TestType() { Name = "Foo", SomeValue = "Bar" };
var serialized = serializer.Serialize(testObj);
var deserialized = serializer.Deserialize(serialized);
Assert.That(deserialized, Is.TypeOf<TestType>());
Assert.That(((TestType)deserialized).Name, Is.EqualTo(testObj.Name));
Assert.That(((TestType)deserialized).SomeValue, Is.EqualTo(testObj.SomeValue));
}
开发者ID:PrintFleet,项目名称:AL-Redis,代码行数:15,代码来源:SSJsonSerializerTests.cs
示例20: SerializeTest
public void SerializeTest()
{
object obj = new TestType()
{
Id = 1,
Name = "Deneme 1",
NullProperty = null,
DateTimeProperty = new DateTime(2012, 7, 26, 13, 21, 36, 0),
GuidProperty = new Guid("38fa9452-4491-4a96-a48b-be0854f10286")
};
//string expected = string.Empty; // TODO: Initialize to an appropriate value
string actual = JsonNetSerializerHelper.Serialize(obj);
Assert.IsNotNull(actual);
Assert.AreEqual(actual, JsonString);
Debug.Write(actual);
}
开发者ID:alperkonuralp,项目名称:AK_Common_Operations,代码行数:16,代码来源:JsonNetSerializerHelperTest.cs
注:本文中的TestType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论