forked from devlooped/moq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetupViewModelFixture.cs
56 lines (45 loc) · 1.29 KB
/
SetupViewModelFixture.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace Moq.Visualizer.Tests
{
public class SetupViewModelFixture
{
[Fact]
public void CtorSetsSetupExpression()
{
var target = new SetupViewModel("foo", false, false);
Assert.Equal("foo", target.SetupExpression);
}
[Fact]
public void CtorSetsIsVerifiable()
{
var target = new SetupViewModel("foo", true, false);
Assert.Equal(true, target.IsVerifiable);
}
[Fact]
public void CtorSetsIsNever()
{
var target = new SetupViewModel("foo", false, true);
Assert.Equal(true, target.IsNever);
}
[Fact]
public void CtorSetContainers()
{
var expectedContainer1 = new ContainerViewModel<ICloneable>("bar", new ICloneable[0]);
var expectedContainer2 = new ContainerViewModel<IFormattable>("baz", new IFormattable[0]);
var target = new SetupViewModel("foo", false, false, expectedContainer1, expectedContainer2);
Assert.Equal(2, target.Containers.Count());
Assert.Same(expectedContainer1, target.Containers.ElementAt(0));
Assert.Same(expectedContainer2, target.Containers.ElementAt(1));
}
[Fact]
public void CtorSetsIsExpandedAsFalse()
{
var target = new SetupViewModel("foo", false, false);
Assert.False(target.IsExpanded);
}
}
}