本文整理汇总了C#中TestState类的典型用法代码示例。如果您正苦于以下问题:C# TestState类的具体用法?C# TestState怎么用?C# TestState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestState类属于命名空间,在下文中一共展示了TestState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Expect_that_a_serialized_object_can_be_deserialized_accurately
public void Expect_that_a_serialized_object_can_be_deserialized_accurately()
{
var objIn = new TestState {
A = decimal.MaxValue,
B = "Hello World!",
C = DateTime.MaxValue,
D = long.MaxValue,
E = new byte[] { 1, 2, 3 },
F = true
};
var ms = new MemoryStream(128);
var serializer = new Serializer();
serializer.Serialize(ms, objIn);
ms.Position = 0;
var objOut = serializer.Deserialize<TestState>(ms);
Assert.That(objOut.A == objIn.A);
Assert.That(objOut.B == objIn.B);
Assert.That(objOut.C == objIn.C);
Assert.That(objOut.D == objIn.D);
Assert.That(objOut.E.SequenceEqual(objIn.E));
Assert.That(objOut.F == objIn.F);
}
开发者ID:nbevans,项目名称:EventStreams,代码行数:25,代码来源:SerializerTests.cs
示例2: TestTreeNode
public TestTreeNode(string name, TestNodeType nodeType)
{
this.name=name;
this.nodeType = nodeType;
this.state = TestState.NotRun;
this.nodes = new TestTreeNodeCollection(this);
}
开发者ID:timonela,项目名称:mb-unit,代码行数:7,代码来源:TestTreeNode.cs
示例3: ShouldAddComponentToGameState
public void ShouldAddComponentToGameState()
{
var state = new TestState();
Assert.False(state.HasComponent(typeof (FooComponent)));
var comp = state.AddComponent(new FooComponent());
Assert.True(state.HasComponent(comp));
}
开发者ID:remy22,项目名称:TriEngine,代码行数:7,代码来源:GameStateTests.cs
示例4: CookiesOnTheRequestAndInTheContainer
public async Task CookiesOnTheRequestAndInTheContainer()
{
// ARRANGE
var ts = new TestState
{
Request =
{
Headers =
{
{"Cookie", "a=1; b=2"},
{"cookie", "c=3; "},
{"COOKIE", "d=4;"},
{"cOOKIE", "e=5"}
}
}
};
ts.CookieContainer.Add(ts.Uri, new Cookie("f", "6"));
ts.CookieContainer.Add(ts.Uri, new Cookie("g", "7"));
// ACT
await ts.HttpClient.SendAsync(ts.Request);
// ASSERT
ts.VerifyRequestCookie("a=1; b=2; c=3; d=4; e=5; f=6; g=7");
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:25,代码来源:CookieHandlerTests.cs
示例5: It_Reads_One_Chunk_Asynchronously
public async Task It_Reads_One_Chunk_Asynchronously()
{
// ARRANGE
var ts = new TestState();
// ACT, ASSERT
await ts.ReadAndVerifyAsync(ts.MultipleChunks);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ChunkedStreamTests.cs
示例6: It_Reads_Multiple_Chunks_With_A_Large_Buffer_Asynchronously
public async Task It_Reads_Multiple_Chunks_With_A_Large_Buffer_Asynchronously()
{
// ARRANGE
var ts = new TestState { BufferSize = 1024 };
// ACT, ASSERT
await ts.ReadAndVerifyAsync(ts.MultipleChunks);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ChunkedStreamTests.cs
示例7: It_Reads_One_Chunk_Synchronously
public void It_Reads_One_Chunk_Synchronously()
{
// ARRANGE
var ts = new TestState();
// ACT, ASSERT
ts.ReadAndVerify(ts.MultipleChunks);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ChunkedStreamTests.cs
示例8: It_Reads_Multiple_Chunks_With_A_Large_Buffer_Synchronously
public void It_Reads_Multiple_Chunks_With_A_Large_Buffer_Synchronously()
{
// ARRANGE
var ts = new TestState { BufferSize = 1024 };
// ACT, ASSERT
ts.ReadAndVerify(ts.MultipleChunks);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ChunkedStreamTests.cs
示例9: It_Can_Read_All_Lines_With_Trailing_Line_Endings
public async Task It_Can_Read_All_Lines_With_Trailing_Line_Endings()
{
// ARRANGE
var ts = new TestState();
// ACT, ASSERT
await ts.VerifyAllLinesAsync(ts.TrailingLineEndings);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ByteStreamReaderTests.cs
示例10: Process
private void Process(string displayName, TestState state, string output = "")
{
Console.WriteLine($"{state} - {displayName}");
var result = new TestResultData(displayName, state, output);
_writer.Write(TestDataKind.Value);
_writer.Write(result);
}
开发者ID:nguerrera,项目名称:xunit.runner.wpf,代码行数:8,代码来源:RunUtil.cs
示例11: Fail
public void Fail(Exception exception)
{
if (exception == null)
throw new ArgumentNullException("exception");
this.Stop();
this.state = TestState.Failure;
this.exception = exception;
}
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:8,代码来源:Result.cs
示例12: ShouldHaveComponentOfType
public void ShouldHaveComponentOfType()
{
var state = new TestState();
var fooComp = new FooComponent();
state.AddComponent(fooComp);
Assert.True(state.HasComponent(typeof(FooComponent)));
Assert.False(state.HasComponent(typeof(BarComponent)));
}
开发者ID:remy22,项目名称:TriEngine,代码行数:8,代码来源:GameStateTests.cs
示例13: It_Returns_All_Contents_With_A_Large_Buffer
public async Task It_Returns_All_Contents_With_A_Large_Buffer()
{
// ARRANGE
var ts = new TestState();
// ACT, ASSERT
await ts.VerifyReadLineThenReadBytesAsync(ts.TrailingLineEndings, ts.GetLength(ts.TrailingLineEndings) * 2);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:8,代码来源:ByteStreamReaderTests.cs
示例14: ShouldHaveComponentMatchingPredicate
public void ShouldHaveComponentMatchingPredicate()
{
var state = new TestState();
var fooComp = new FooComponent();
state.AddComponent(fooComp);
Assert.True(state.HasComponent(c => ((FooComponent)c).Test == "Foo"));
Assert.False(state.HasComponent(c => ((FooComponent)c).Test == "Bar"));
}
开发者ID:remy22,项目名称:TriEngine,代码行数:8,代码来源:GameStateTests.cs
示例15: ShouldOnlyHaveExactReferenceToComponent
public void ShouldOnlyHaveExactReferenceToComponent()
{
var state = new TestState();
var fooComp = new FooComponent();
var fooComp2 = new FooComponent();
state.AddComponent(fooComp);
Assert.True(state.HasComponent(fooComp));
Assert.False(state.HasComponent(fooComp2));
}
开发者ID:remy22,项目名称:TriEngine,代码行数:9,代码来源:GameStateTests.cs
示例16: It_Returns_Correct_Line_With_Large_Buffer
public async Task It_Returns_Correct_Line_With_Large_Buffer()
{
// ARRANGE
var ts = new TestState();
ts.BufferSize = ts.GetLength(ts.TwoLines) * 2;
// ACT, ASSERT
await ts.VerifyAllLinesAsync(ts.TwoLines);
}
开发者ID:tablesmit,项目名称:SocketToMe,代码行数:9,代码来源:ByteStreamReaderTests.cs
示例17: 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
示例18: TestResult
public TestResult(string runner, string assembly, string fixture, double milliseconds, string testName, TestState state, string message)
{
Runner = runner;
Assembly = assembly;
TestFixture = fixture;
DurationInMilliseconds = milliseconds;
TestName = testName;
State = state;
Message = message;
}
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:10,代码来源:TestResults.cs
示例19: ShouldRemoveAllComponentsFromGameState
public void ShouldRemoveAllComponentsFromGameState()
{
var state = new TestState();
var fooComp1 = new FooComponent();
var fooComp2 = new FooComponent();
state.AddComponent(fooComp1);
state.AddComponent(fooComp2);
Assert.AreEqual(state.GetAllComponents().Count(), 2);
state.RemoveAllComponents();
Assert.IsEmpty(state.GetAllComponents());
}
开发者ID:remy22,项目名称:TriEngine,代码行数:11,代码来源:GameStateTests.cs
示例20: CompareToForSorting
public static int CompareToForSorting(this TestState a, TestState b)
{
if (a == b) {
return 0;
}
int aOrderId = GetOrderId(a);
int bOrderId = GetOrderId(b);
return aOrderId - bOrderId;
}
开发者ID:pythe,项目名称:wristpass,代码行数:11,代码来源:TestState.cs
注:本文中的TestState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论