本文整理汇总了C#中TestType类的典型用法代码示例。如果您正苦于以下问题:C# TestType类的具体用法?C# TestType怎么用?C# TestType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestType类属于命名空间,在下文中一共展示了TestType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: ShowAbstractFactory
public void ShowAbstractFactory()
{
TestType tt = new TestType();
ISomething sm = SomethingFactory.CreateSomething();
sm.InsertSomething(tt);
sm.GetSomething("1234");
}
示例3: TestResults
public TestResults( int totalRes, int correctRes, DateTime timeOfPassage, TestType type)
{
TotalRes = totalRes;
CorrectRes = correctRes;
TimeOfPassage = timeOfPassage;
Type = type;
}
示例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();
}
}
示例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);
}
示例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 = "";
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例13: Edit
public ActionResult Edit(int id, TestType testType)
{
try
{
_dbTestTypeRepository.Update(testType);
return RedirectToAction("Index");
}
catch
{
return View(testType);
}
}
示例14: Create
public ActionResult Create(TestType testType)
{
try
{
_dbTestTypeRepository.Insert(testType);
return RedirectToAction("Index");
}
catch
{
return View(testType);
}
}
示例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();
}