forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTupleFixture.cs
More file actions
55 lines (44 loc) · 1.34 KB
/
Copy pathTupleFixture.cs
File metadata and controls
55 lines (44 loc) · 1.34 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
47
48
49
50
51
52
53
54
55
using LibGit2Sharp.Core.Compat;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;
namespace LibGit2Sharp.Tests
{
public class TupleFixture
{
const int integer = 2;
const string stringy = "hello";
private readonly Tuple<int, string> sut = new Tuple<int, string>(integer, stringy);
[Fact]
public void Properties()
{
sut.Item1.ShouldEqual(integer);
sut.Item2.ShouldEqual(stringy);
}
[Fact]
public void GetHashCodeIsTheSame()
{
var sut2 = new Tuple<int, string>(integer, stringy);
sut.GetHashCode().ShouldEqual(sut2.GetHashCode());
}
[Fact]
public void GetHashCodeIsDifferent()
{
var sut2 = new Tuple<int, string>(integer + 1, stringy);
sut.GetHashCode().ShouldNotEqual(sut2.GetHashCode());
}
[Fact]
public void VerifyEquals()
{
var sut2 = new Tuple<int, string>(integer, stringy);
sut.Equals(sut2).ShouldBeTrue();
Equals(sut, sut2).ShouldBeTrue();
}
[Fact]
public void VerifyNotEquals()
{
var sut2 = new Tuple<int, string>(integer + 1, stringy);
sut.Equals(sut2).ShouldBeFalse();
Equals(sut, sut2).ShouldBeFalse();
}
}
}