forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageSampleTest.cs
More file actions
46 lines (40 loc) · 1.4 KB
/
Copy pathImageSampleTest.cs
File metadata and controls
46 lines (40 loc) · 1.4 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 ImageSampleTest
{
[Fact]
public void Constructor()
{
ImageSample sample = new ImageSample("http://host/image.png");
Assert.Equal("http://host/image.png", sample.Src);
}
[Fact]
public void Constructor_ThrowsArgumentNullException()
{
Assert.Throws<ArgumentNullException>(() => new ImageSample(null));
}
[Fact]
public void Equals_ReturnsTrue()
{
ImageSample sample = new ImageSample("http://host/image.png");
Assert.Equal(new ImageSample("http://host/image.png"), sample);
}
[Fact]
public void ToString_ReturnsSrc()
{
ImageSample sample = new ImageSample("http://host/image.png");
Assert.Equal("http://host/image.png", sample.ToString());
}
[Fact]
public void GetHashCode_ReturnsSrcHashCode()
{
ImageSample sample = new ImageSample("http://host/image.png");
Assert.Equal("http://host/image.png".GetHashCode(), sample.GetHashCode());
}
}
}