copypastedeveloper / given

Given is a bdd library made with the intent of wrapping common testing frameworks easily.
10 stars 2 forks source link

There is no output for a Context.Given when called from a base class. #6

Open KarsonAlford opened 10 years ago

KarsonAlford commented 10 years ago

This behavior makes sense when the call is made in a static context. However, this is also happening when called from a before.

[TestClass, Ignore] // All unit test base classes should be ignored.
public abstract class expectations_for_XXX : Scenario
{
    protected static AssessmentInstance AssessmentInstance;
    protected static List<ResultQuestionViewModel> Result { get; set; }

    before initialize = () =>
    {
        Mapper.Reset(); // Clear the static MappingEngine.
        Mapper.AddProfile<AssessmentScoreMappingProfile>();

        AssessmentInstance = Context.Given<AssessmentInstance>(AssessmentScoreContextProvider.EverythingAssessment);
    };
copypastedeveloper commented 10 years ago

probably not done enough testing with base classes. i'll look into this.