Skip to content

Fake should be able to split a MSBuild-project into a test and implementation project #4

Closed

Description

@forki

Consider a project with side-by-side specification:

Name: MyProject.csproj
Dependency on NUnit.Framework.dll
Class1.cs
Test.Class1.Something.cs
Test.Class1.Whatever.cs
Class2.cs
Test.Class2.Something.cs

This side-by-side specification is good for development, but for a release build we want to split this into two separate projects like this:

Name: MyProject.csproj
Class1.cs
Class2.cs

Name: Test.MyProject.csproj
Dependency on NUnit.Framework.dll
Dependency on MyProject.csproj
Test.Class1.Something.cs
Test.Class1.Whatever.cs
Test.Class2.Something.cs

The splitting should work for all testprojects and based on file name conventions.

Activity

  1. ilkerde commented on Jul 2, 2010

    @ilkerde
    Contributor

    I don't know fake's functionality, so bare with me on that. However, I'd recommend to split the feature into smaller chunks and implement filtering first. In the context of a release build, the benefit of having specifications packaged is rather small. I wouldn't drop the idea entirely though, just postpone it. IMHO it's good enough for a first shot to just filter out the specs using conventions.

    Conventions may differ for different spec. frameworks, so filter criteria needs to be adjustable.

    Once the filter (for files and test dll's) is done, you soon will recon the need for a "boarding" build. But for the sake of simplicity, filter would satisfy a lot!

    This feature would be one more great reason to switch over to fake. I'll surely have a look! Thanks!

  2. AlexZeitler commented on Jul 2, 2010

    @AlexZeitler
    Contributor

    I agree with Ilker - there's no need to elaborate ;-)

  3. panesofglass commented on Jul 6, 2010

    @panesofglass
    Contributor

    Interesting. I've never thought of the need for this before. Why aren't you already using separate projects?

  4. forki commented on Jul 6, 2010

    @forki
    MemberAuthor

    Hi Ryan,

    we had an interesting discussion about side-by-side specifications at the .NET OpenSpace in Karlsruhe. The idea is to put specs, test data and implementation next to each other since the specs are documentation for the implementation.

    By using a tool like http://mokosh.co.uk/vscommands/ we are able to group the implementation with the specs (see http://gist.github.com/457248).

    But of course we don't want to deploy the tests. By automatically removing all spec files and test framework references we can easily build a release.

    What do you think?

    Regards,
    Steffen

  5. panesofglass commented on Jul 8, 2010

    @panesofglass
    Contributor

    I love it. I had thought about that at one point, but I've now gotten so used to having completely separate folder structures/projects for tests/specs. I'd love them to be together again, though. Great idea!

  6. forki commented on Jul 11, 2010

    @forki
    MemberAuthor

    First version in 1.33.0 released

  7. added a commit that references this issue on May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions