forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextSampleTest.cs
More file actions
46 lines (40 loc) · 1.3 KB
/
Copy pathTextSampleTest.cs
File metadata and controls
46 lines (40 loc) · 1.3 KB
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
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.TestCommon;
using ROOT_PROJECT_NAMESPACE.Areas.HelpPage;
namespace WebApiHelpPageWebHost.UnitTest
{
public class TextSampleTest
{
[Fact]
public void Constructor()
{
TextSample sample = new TextSample("some text");
Assert.Equal("some text", sample.Text);
}
[Fact]
public void Constructor_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new TextSample(null));
}
[Fact]
public void Equals_ReturnsTrue()
{
TextSample sample = new TextSample("some text");
Assert.Equal(new TextSample("some text"), sample);
}
[Fact]
public void ToString_ReturnsText()
{
TextSample sample = new TextSample("some text");
Assert.Equal("some text", sample.ToString());
}
[Fact]
public void GetHashCode_ReturnsTextHashCode()
{
TextSample sample = new TextSample("some text");
Assert.Equal("some text".GetHashCode(), sample.GetHashCode());
}
}
}