var globalHooks = require('./_globalHooks');

var httpConfig = require('./support/httpConfig');
var assert = require('assert');
var eventstore = require('../index.js');
var uuid = require('uuid');

describe('Http Client - Delete stream', function() {
    it('Should return successful on stream delete', function() {
        var client = eventstore.http(httpConfig);

        var testStream = 'TestStream-' + uuid.v4();
        return client.writeEvent(testStream, 'TestEventType', {
            something: '123'
        }).then(function() {
            return client.deleteStream(testStream).then(function() {
                return client.checkStreamExists(testStream).then(function(exists) {
                    assert.equal(false, exists);
                });
            }).catch(function(err) {
                assert.fail(err.message);
            });
        });
    });

    it('Should fail when a stream does not exist', function() {
        var client = eventstore.http(httpConfig);

        var testStream = 'TestStream-' + uuid.v4();

        return client.deleteStream(testStream).then(function() {
            assert.fail('Should have failed because stream does not exist');
        }).catch(function(err){
            assert(err);
        });
    });
});
@@ -893,24 +893,1343 @@
 %0A    %7D);%0D%0A%0D%0A
+    it('Should return successful on writing to a stream that has been soft deleted', function() %7B%0D%0A        var client = eventstore.http(httpConfig);%0D%0A%0D%0A        var testStream = 'TestStream-' + uuid.v4();%0D%0A%0D%0A        return client.writeEvent(testStream, 'TestEventType', %7B%0D%0A            something: '123'%0D%0A        %7D).then(function() %7B%0D%0A            return client.deleteStream(testStream).then(function() %7B%0D%0A                return client.writeEvent(testStream, 'TestEventType', %7B%0D%0A                    something: '456'%0D%0A                %7D);%0D%0A            %7D).catch(function(err) %7B%0D%0A                assert.fail(err.message);%0D%0A            %7D);%0D%0A        %7D);%0D%0A    %7D);%0D%0A%0D%0A    it('Should return successful on stream delete hard delete', function() %7B%0D%0A        var client = eventstore.http(httpConfig);%0D%0A%0D%0A        var testStream = 'TestStream-' + uuid.v4();%0D%0A        return client.writeEvent(testStream, 'TestEventType', %7B%0D%0A            something: '123'%0D%0A        %7D).then(function() %7B%0D%0A            return client.deleteStream(testStream, true).then(function() %7B%0D%0A                return client.checkStreamExists(testStream).then(function(exists) %7B%0D%0A                    assert.equal(false, exists);%0D%0A                %7D);%0D%0A            %7D).catch(function(err) %7B%0D%0A                assert.fail(err.message);%0D%0A            %7D);%0D%0A        %7D);%0D%0A    %7D);%0D%0A%0D%0A
     it('Shou
@@ -2563,16 +2563,17 @@
 ion(err)
+ 
 %7B%0D%0A     
@@ -2614,12 +2614,809 @@
     %7D);%0D
+%0A%0D%0A    it('Should return HTTP 410 when a writing to a stream that has been hard deleted', function() %7B%0D%0A        var client = eventstore.http(httpConfig);%0D%0A%0D%0A        var testStream = 'TestStream-' + uuid.v4();%0D%0A%0D%0A        return client.writeEvent(testStream, 'TestEventType', %7B%0D%0A            something: '123'%0D%0A        %7D).then(function() %7B%0D%0A            return client.deleteStream(testStream, true).then(function() %7B%0D%0A                return client.writeEvent(testStream, 'TestEventType', %7B%0D%0A                    something: '456'%0D%0A                %7D).then(function() %7B%0D%0A                    assert.fail('Should have failed because stream does not exist');%0D%0A                %7D);%0D%0A            %7D).catch(function(err) %7B%0D%0A                assert.equal(410, err.statusCode);%0D%0A            %7D);%0D%0A        %7D);%0D%0A    %7D);%0D
 %0A%7D);

add tests for hard deleting of streams