-
Notifications
You must be signed in to change notification settings - Fork 315
/
SessionEventsTests.cs
55 lines (43 loc) · 1.51 KB
/
SessionEventsTests.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.TestPlatform.ObjectModel.UnitTests;
[TestClass]
public class SessionEventsTests
{
private readonly SessionStartEventArgs _sessionStartEventArgs;
public SessionEventsTests()
{
var properties = new Dictionary<string, object>
{
{ "property1", 1 },
{ "property2", 2 }
};
_sessionStartEventArgs = new SessionStartEventArgs(properties);
}
[TestMethod]
public void SessionStartEventArgsGetPropertiesShouldGetPropertiesEnumerator()
{
var properties = _sessionStartEventArgs.GetProperties();
int propertiesCount = 0;
while (properties.MoveNext())
{
propertiesCount++;
}
Assert.AreEqual(2, propertiesCount);
}
[TestMethod]
public void SessionStartEventArgsGetPropertyValueShouldGetPropertyValue()
{
var value = _sessionStartEventArgs.GetPropertyValue<int>("property1");
Assert.AreEqual(1, value);
}
[TestMethod]
public void SessionStartEventArgsGetPropertyValueShouldGetPropertyValueInObject()
{
var value = _sessionStartEventArgs.GetPropertyValue("property1");
Assert.AreEqual(1, value);
}
}