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

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

            // When, Then
            Assert.Throws <ArgumentNullException>(() => fixture.Run());
        }
Example #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\"");
        }
Example #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}\""));
        }