forked from microsoft/BotFramework-FunctionalTests
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestScriptItem.cs
68 lines (61 loc) · 2.06 KB
/
TestScriptItem.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Microsoft.Bot.Builder.Testing.TranscriptConverter
{
/// <summary>
/// TestRunner's representation of an activity.
/// </summary>
public class TestScriptItem
{
/// <summary>
/// Initializes a new instance of the <see cref="TestScriptItem"/> class.
/// </summary>
/// <param name="assertions">The activity assertion collection.</param>
public TestScriptItem(List<string> assertions = default)
{
Assertions = assertions ?? new List<string>();
}
/// <summary>
/// Gets or sets the activity type.
/// </summary>
/// <value>
/// The activity type.
/// </value>
[JsonProperty("type")]
public string Type { get; set; }
/// <summary>
/// Gets or sets the activity role.
/// </summary>
/// <value>
/// The activity role.
/// </value>
[JsonProperty("role")]
public string Role { get; set; }
/// <summary>
/// Gets or sets the activity text.
/// </summary>
/// <value>
/// The activity text.
/// </value>
[JsonProperty("text")]
public string Text { get; set; }
/// <summary>
/// Gets the activity assertion collection.
/// </summary>
/// <value>
/// The activity assertion collection.
/// </value>
[JsonProperty("assertions")]
public List<string> Assertions { get; } = new List<string>();
/// <summary>
/// Prevents the serializer from creating the assertions collection if its empty.
/// </summary>
/// <returns><c>true</c> if the assertions collection should be serialized.</returns>
public bool ShouldSerializeAssertions()
{
return Assertions.Count > 0;
}
}
}