示例#1
0
        public void ShouldThrowWhenNoFilesProvided()
        {
            // Given
            ScriptyFixture fixture = new ScriptyFixture(r => r.Evaluate());

            // When, Then
            Assert.Throws <ArgumentException>(() => fixture.Run());
        }
示例#2
0
        public void ShouldThrowOnNullProjectPath()
        {
            // Given
            ScriptyFixture fixture = new ScriptyFixture(r => r.Evaluate())
            {
                ProjectFilePath = null
            };

            // When, Then
            Assert.Throws <ArgumentNullException>(() => fixture.Run());
        }
示例#3
0
        public void ShouldAddMultipleFiles()
        {
            // Given
            ScriptyFixture fixture = new ScriptyFixture(r => r.Evaluate("file.csx", "script.csx"));

            // When
            ToolFixtureResult result = fixture.Run();

            // Then
            FilePath proj = fixture.GetProjectFilePath();

            Assert.True(result.Args == $"\"{proj}\" \"file.csx\" \"script.csx\"");
        }
示例#4
0
        public void ShouldAddProjectFile()
        {
            // Given
            ScriptyFixture fixture = new ScriptyFixture(r => r.Evaluate("file.csx"));

            // When
            ToolFixtureResult result = fixture.Run();

            // Then
            FilePath proj = fixture.GetProjectFilePath();

            Assert.True(result.Args.StartsWith($"\"{proj}\""));
        }