コード例 #1
0
        public void ShouldParseSolutionFileWithTests()
        {
            var path     = Path.Combine(Environment.CurrentDirectory, "test-wt.sln");
            var testFile = SolutionFile.Parse(path);
            var target   = new SolutionDecriptorBuilder(s => testFile);
            var result   = target.Build(path);

            Assert.Collection(result.Tests,
                              p =>
            {
                Assert.Equal(ProjectType.Tests, p.Type);
                Assert.Equal("Entity.Tests", p.Name);
            },
                              p =>
            {
                Assert.Equal(ProjectType.Tests, p.Type);
                Assert.Equal("API.Test", p.Name);
            });
            Assert.Equal("test-wt.sln", result.Name);
        }
コード例 #2
0
        public void ShouldParseSolutionFileWithoutTests()
        {
            var path     = Path.Combine(Environment.CurrentDirectory, "test.sln");
            var testFile = SolutionFile.Parse(path);
            var target   = new SolutionDecriptorBuilder((s) => testFile);
            var result   = target.Build(path);

            Assert.Collection(result.Projects,
                              p =>
            {
                Assert.Equal(ProjectType.ClassLibrary, p.Type);
                Assert.Equal("Entity", p.Name);
            },
                              p =>
            {
                Assert.Equal(ProjectType.ClassLibrary, p.Type);
                Assert.Equal("API", p.Name);
            });
            Assert.Empty(result.Tests);
            Assert.Equal("test.sln", result.Name);
            Assert.Equal(Environment.CurrentDirectory, result.Root);
            Assert.Equal(path, result.Path);
        }