/// <summary>
    /// Returns a file system implementation, which is assigned
    /// to the <see cref="TestContext.FileSystem"/> property.
    /// </summary>
    /// <param name="localTestFolder">The temporary test folder that is
    /// used by the context. This is actually just the <see cref="TestContext.LocalTestRoot"/>
    /// reference.</param>
    protected override IFileSystemProvider InitFileSystem(DirectoryInfo localTestFolder)
    {
      ServiceFileSystem = GetServiceProvider();
      var settings = new VfsServiceSettings();

      ServiceHost = new TestServiceHost { Configuration = new TestConfiguration(ServiceFileSystem, settings) };

      ServiceBaseUri = "http://localhost:33456/";
      ServiceHost.Initialize(new[] { ServiceBaseUri }, "/", null);
      ServiceHost.StartListening();

//      //TODO remove debug code
//      ServiceBaseUri = "http://127.0.0.1:56789/";

      return new FileSystemFacade(ServiceBaseUri);
    }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public TestConfiguration(IFileSystemProvider provider, VfsServiceSettings settings)
 {
   Provider = provider;
   Settings = settings;
 }
예제 #3
0
 protected virtual VfsServiceSettings CustomizeSettings(VfsServiceSettings settings)
 {
   return settings; 
 }
예제 #4
0
 /// <summary>
 /// Registers service settings with Open Rasta's dependency injection mechanism.
 /// </summary>
 /// <param name="settings">Common settings that can be retrieved by the handler classes
 /// if required.</param>
 public static void RegisterSettings(VfsServiceSettings settings)
 {
   Ensure.ArgumentNotNull(settings, "settings");
   ResourceSpace.Uses.Resolver.AddDependencyInstance<VfsServiceSettings>(settings);
 }
예제 #5
0
 /// <summary>
 /// Registers service settings with Open Rasta's dependency injection mechanism.
 /// </summary>
 /// <param name="settings">Common settings that can be retrieved by the handler classes
 /// if required.</param>
 public static void RegisterSettings(VfsServiceSettings settings)
 {
     Ensure.ArgumentNotNull(settings, "settings");
     ResourceSpace.Uses.Resolver.AddDependencyInstance <VfsServiceSettings>(settings);
 }