Skip to content

Instantly share code, notes, and snippets.

@fschwiet
Created January 9, 2014 22:34
Show Gist options
  • Save fschwiet/8343378 to your computer and use it in GitHub Desktop.
Save fschwiet/8343378 to your computer and use it in GitHub Desktop.
just dreamin
<<someHypthoticalScriptCS command: inherit from GivenWhenThenFixture override Specify>>
var someDllPath = arrange(() => GetPathOfBinDeployed("SomeTestLibrary.dll"));
expect(() => File.Exists(someDllPath));
given("an AppDomain wrapper for a test DLL", delegate()
{
    var appDomainWrapper = arrange(() => new AppDomainWrapper(someDllPath));
    then("objects can be instantiated in the AppDomain", () =>
    {
        var o = appDomainWrapper.CreateObject<NJasmine.Marshalled.Executor>("NJasmine.dll");
    });
    then("the test assembly's configuration file is loaded", () =>
    {
        var o = appDomainWrapper.CreateObject<NJasmine.Marshalled.Executor.AppSettingLoader>("NJasmine.dll");
        string result = o.Get("someConfigurationValue");
        expect(() => result == "#winning");
    });
    then("the tests can be enumerated", () =>
    {
        var result = UsingAppDomain.LoadTestNames(appDomainWrapper, someDllPath);
        expect(() => result.Contains("SomeTestLibrary.ASingleTest, first test"));
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment