forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersionCommandTests.cs
More file actions
36 lines (28 loc) · 977 Bytes
/
VersionCommandTests.cs
File metadata and controls
36 lines (28 loc) · 977 Bytes
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
using System.Diagnostics;
using System.Reflection;
using Moq;
using Ploeh.AutoFixture.Xunit;
using ScriptCs.Command;
using ScriptCs.Contracts;
using Xunit.Extensions;
namespace ScriptCs.Tests
{
public class VersionCommandTests
{
public class ExecuteMethod
{
[Theory, ScriptCsAutoData]
public void VersionCommandShouldOutputVersion([Frozen] Mock<IConsole> console, CommandFactory factory)
{
// Arrange
var args = new ScriptCsArgs { Version = true };
var assembly = typeof(ScriptCsArgs).Assembly;
var currentVersion = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion;
// Act
factory.CreateCommand(args, new string[0]).Execute();
// Assert
console.Verify(x => x.WriteLine(It.Is<string>(y => y.Contains(currentVersion.ToString()))));
}
}
}
}