<commit_before>package com.ullink

import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.internal.os.OperatingSystem
import org.gradle.testfixtures.ProjectBuilder
import org.gradle.util.VersionNumber
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException

import static org.junit.Assert.assertNotNull

class PosixMsbuildLocateTests {
    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @Before
    public void beforeMethod() {
        org.junit.Assume.assumeTrue OperatingSystem.current().unix
        org.junit.Assume.assumeTrue "mono --version".execute().in.text != null
    }

    @Test
    public void testMsBuildCanBeFound() {
        def resolver = new PosixMsbuildResolver()

        // Unspecified version
        Project p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin

        def msbuild = resolver.locateMsBuild(p.tasks.msbuild.version)
        assertNotNull(msbuild)

        // Specified version
        p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin
        def msbuildVersion = msbuild[1]
        p.msbuild {
            version = msbuildVersion
        }
        msbuild = resolver.locateMsBuild(VersionNumber.parse(p.tasks.msbuild.version))
        assertNotNull(msbuild)
    }

    @Test
    public void givenInvalidMSBuildVersion_throwsException() {
        def resolver = new PosixMsbuildResolver()
        Project p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin
        p.msbuild {
            version = 999.3
        }

        expectedException.expect(GradleException.class)
        expectedException.expectMessage("Cannot find an msbuild binary")
        resolver.locateMsBuild(VersionNumber.parse(p.tasks.msbuild.version))

    }
}<commit_msg>Fixing test for missing posix msbuild version.<commit_after>package com.ullink

import org.gradle.api.Project
import org.gradle.internal.os.OperatingSystem
import org.gradle.testfixtures.ProjectBuilder
import org.gradle.util.VersionNumber
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException

import static org.junit.Assert.assertNotNull
import static org.junit.Assert.assertNull

class PosixMsbuildLocateTests {
    @Rule
    public ExpectedException expectedException = ExpectedException.none();

    @Before
    public void beforeMethod() {
        org.junit.Assume.assumeTrue OperatingSystem.current().unix
        org.junit.Assume.assumeTrue "mono --version".execute().in.text != null
    }

    @Test
    public void testMsBuildCanBeFound() {
        def resolver = new PosixMsbuildResolver()

        // Unspecified version
        Project p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin

        def msbuild = resolver.locateMsBuild(p.tasks.msbuild.version)
        assertNotNull(msbuild)

        // Specified version
        p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin
        def msbuildVersion = msbuild[1]
        p.msbuild {
            version = msbuildVersion
        }
        msbuild = resolver.locateMsBuild(VersionNumber.parse(p.tasks.msbuild.version))
        assertNotNull(msbuild)
    }

    @Test
    public void givenInvalidMSBuildVersion_throwsException() {
        def resolver = new PosixMsbuildResolver()
        Project p = ProjectBuilder.builder().build()
        p.apply plugin: MsbuildPlugin
        p.msbuild {
            version = 999.3
        }

        def msbuild = resolver.locateMsBuild(VersionNumber.parse(p.tasks.msbuild.version))
        assertNull(msbuild)

    }
}
{'fraction_non_alphanumeric': 0.0872972972972973, 'fraction_numerical': 0.002702702702702703, 'mean_word_length': 2.9372340425531913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5322670', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1008, 'n_words': 204}