Skip to content

Commit

Permalink
closes #14
Browse files Browse the repository at this point in the history
- a few more places to stylecop, but they'll be covered in future issues
  • Loading branch information
JesseBuesking committed Mar 2, 2015
1 parent c1552fe commit 06e4e9d
Show file tree
Hide file tree
Showing 40 changed files with 1,458 additions and 2,314 deletions.
106 changes: 55 additions & 51 deletions BB.Caching.Tests/Caching/ConfigTests.cs
Original file line number Diff line number Diff line change
@@ -1,59 +1,28 @@
using System;
using System.Threading;
using BB.Caching.Redis;
using ProtoBuf;
using Xunit;

namespace BB.Caching.Tests.Caching
namespace BB.Caching.Tests.Caching
{
public class ConfigTests : IUseFixture<DefaultTestFixture>, IUseFixture<ConfigTests.ConfigTestsFixture>, IDisposable
{
public class ConfigTestsFixture : IDisposable
{
public ConfigTestsFixture()
{
try
{
Cache.Prepare();
}
catch (PubSub.ChannelAlreadySubscribedException)
{ }
using System;
using System.Threading;

Cache.Shared.Keys.DeleteAsync(KEY).Wait();
Cache.Shared.Keys.DeleteAsync(KEY2).Wait();
}
using BB.Caching.Redis;

public void Dispose()
{
Cache.Shared.Keys.DeleteAsync(KEY).Wait();
Cache.Shared.Keys.DeleteAsync(KEY2).Wait();
}
}
using ProtoBuf;

[ProtoContract]
public class ConfigDummy
{
[ProtoMember(1)]
public int One
{
get;
set;
}

[ProtoMember(2)]
public int Two
{
get;
set;
}
}
using Xunit;

public class ConfigTests : IUseFixture<DefaultTestFixture>, IUseFixture<ConfigTests.ConfigTestsFixture>, IDisposable
{
private const string KEY = "ConfigTests.Key";

private const string KEY2 = "ConfigTests.Key2";

private const string VALUE = "ConfigTests.Value";

private readonly ConfigDummy _value = new ConfigDummy
{
One = 1,
Two = 2
};

public ConfigTests()
{
Cache.Shared.Keys.DeleteAsync(KEY).Wait();
Expand All @@ -72,12 +41,6 @@ public void Dispose()
Assert.False(Cache.Shared.Keys.ExistsAsync(KEY2).Result);
}

private readonly ConfigDummy _value = new ConfigDummy
{
One = 1,
Two = 2
};

[Fact]
public void Set()
{
Expand Down Expand Up @@ -189,5 +152,46 @@ public void SetFixture(ConfigTestsFixture data)
public void SetFixture(DefaultTestFixture data)
{
}

public class ConfigTestsFixture : IDisposable
{
public ConfigTestsFixture()
{
try
{
Cache.Prepare();
}
catch (PubSub.ChannelAlreadySubscribedException)
{
}

Cache.Shared.Keys.DeleteAsync(KEY).Wait();
Cache.Shared.Keys.DeleteAsync(KEY2).Wait();
}

public void Dispose()
{
Cache.Shared.Keys.DeleteAsync(KEY).Wait();
Cache.Shared.Keys.DeleteAsync(KEY2).Wait();
}
}

[ProtoContract]
public class ConfigDummy
{
[ProtoMember(1)]
public int One
{
get;
set;
}

[ProtoMember(2)]
public int Two
{
get;
set;
}
}
}
}
63 changes: 32 additions & 31 deletions BB.Caching.Tests/Caching/CoreTests.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using System.Runtime.Remoting.Channels;
using System.Threading;
using BB.Caching.Caching;
using BB.Caching.Redis;
using Xunit;

namespace BB.Caching.Tests.Caching
namespace BB.Caching.Tests.Caching
{
using System;
using System.Threading;

using BB.Caching.Caching;
using BB.Caching.Redis;

using Xunit;

public class CoreTests : IUseFixture<DefaultTestFixture>, IUseFixture<CoreTests.CoreTestsFixture>, IDisposable
{
private const string KEY = "CoreTests.Key";
Expand All @@ -15,29 +16,6 @@ public class CoreTests : IUseFixture<DefaultTestFixture>, IUseFixture<CoreTests.

private const string VALUE2 = "CoreTests.Value2";

public class CoreTestsFixture : IDisposable
{
public CoreTestsFixture()
{
try
{
Cache.Prepare();
}
catch (PubSub.ChannelAlreadySubscribedException)
{
}

Cache.Memory.Strings.Delete(KEY);
Cache.Shared.Keys.Delete(KEY);
}

public void Dispose()
{
Cache.Memory.Strings.Delete(KEY);
Cache.Shared.Keys.Delete(KEY);
}
}

public CoreTests()
{
Cache.Memory.Strings.Delete(KEY);
Expand Down Expand Up @@ -1622,5 +1600,28 @@ public void GetSetSlidingMemoryAndRedisAsync()
Assert.False(red.Exists);
Assert.Equal(null, red.Value);
}

public class CoreTestsFixture : IDisposable
{
public CoreTestsFixture()
{
try
{
Cache.Prepare();
}
catch (PubSub.ChannelAlreadySubscribedException)
{
}

Cache.Memory.Strings.Delete(KEY);
Cache.Shared.Keys.Delete(KEY);
}

public void Dispose()
{
Cache.Memory.Strings.Delete(KEY);
Cache.Shared.Keys.Delete(KEY);
}
}
}
}
14 changes: 8 additions & 6 deletions BB.Caching.Tests/Caching/Memory/StringsTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System;
using System.Globalization;
using System.Threading;
using BB.Caching.Caching;
using Xunit;

namespace BB.Caching.Tests.Caching.Memory
{
using System;
using System.Globalization;
using System.Threading;

using BB.Caching.Caching;

using Xunit;

public class StringsTests : IDisposable
{
private const string KEY = "Memory.StringsTests.Key";
Expand Down
Loading

0 comments on commit 06e4e9d

Please sign in to comment.