[smuxi] [Engine-Tests] Added test-cases for JsonMessageBuffer.GetChunkFileName()
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi] [Engine-Tests] Added test-cases for JsonMessageBuffer.GetChunkFileName()
- Date: Fri, 28 Feb 2014 20:24:10 +0000 (UTC)
commit c1e487702290145b04ec2d22932fa008fb8d51ce
Author: Mirco Bauer <meebey meebey net>
Date: Wed Feb 29 23:12:14 2012 +0100
[Engine-Tests] Added test-cases for JsonMessageBuffer.GetChunkFileName()
src/Engine-Tests/JsonMessageBufferTests.cs | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-Tests/JsonMessageBufferTests.cs b/src/Engine-Tests/JsonMessageBufferTests.cs
index 24d23bf..e4f4af3 100644
--- a/src/Engine-Tests/JsonMessageBufferTests.cs
+++ b/src/Engine-Tests/JsonMessageBufferTests.cs
@@ -27,6 +27,10 @@ namespace Smuxi.Engine
[TestFixture]
public class JsonMessageBufferTests : MessageBufferTestsBase
{
+ static JsonMessageBufferTests() {
+ log4net.Config.BasicConfigurator.Configure();
+ }
+
protected override IMessageBuffer CreateBuffer()
{
var dbPath = Path.Combine(Platform.GetBuffersPath("testuser"),
@@ -45,5 +49,25 @@ namespace Smuxi.Engine
return new JsonMessageBuffer("testuser", "testprot", "testnet", "testchat");
}
+ [Test]
+ public void GetChunkFileName()
+ {
+ var buffer = (JsonMessageBuffer) Buffer;
+ Assert.AreEqual("0-999.json", buffer.GetChunkFileName(0L));
+ Assert.AreEqual("0-999.json", buffer.GetChunkFileName(1L));
+ Assert.AreEqual("0-999.json", buffer.GetChunkFileName(999L));
+ Assert.AreEqual("1000-1999.json", buffer.GetChunkFileName(1000L));
+ Assert.AreEqual("1000-1999.json", buffer.GetChunkFileName(1999L));
+ Assert.AreEqual("2000-2999.json", buffer.GetChunkFileName(2500L));
+ Assert.AreEqual("9223372036854774000-9223372036854774999.json",
buffer.GetChunkFileName(Int64.MaxValue - 900));
+ }
+
+ [Test]
+ [ExpectedException(typeof(OverflowException))]
+ public void GetChunkFileNameMaxValue()
+ {
+ var buffer = (JsonMessageBuffer) Buffer;
+ buffer.GetChunkFileName(Int64.MaxValue);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]