kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1173797 [10/10] - in /incubator/kafka/trunk/clients/csharp: ./ lib/StyleCop/ src/Kafka/ src/Kafka/Kafka.Client/ src/Kafka/Kafka.Client/Cfg/ src/Kafka/Kafka.Client/Cluster/ src/Kafka/Kafka.Client/Consumers/ src/Kafka/Kafka.Client/Exceptions...
Date Wed, 21 Sep 2011 19:17:25 GMT
Added: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Producers/PartitioningTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Producers/PartitioningTests.cs?rev=1173797&view=auto
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Producers/PartitioningTests.cs
(added)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Producers/PartitioningTests.cs
Wed Sep 21 19:17:19 2011
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Producers
+{
+    using Kafka.Client.Cfg;
+    using Kafka.Client.Cluster;
+    using Kafka.Client.Producers.Partitioning;
+    using NUnit.Framework;
+
+    [TestFixture]
+    public class PartitioningTests
+    {
+        private ProducerConfig config;
+
+        [TestFixtureSetUp]
+        public void SetUp()
+        {
+            config = new ProducerConfig();
+            config.BrokerPartitionInfo = "1:192.168.0.1:1234,2:192.168.0.2:3456";
+        }
+
+        [Test]
+        public void BrokerPartitionInfoGetAllBrokerInfoTest()
+        {
+            IBrokerPartitionInfo brokerPartitionInfo = new ConfigBrokerPartitionInfo(config);
+            var allInfo = brokerPartitionInfo.GetAllBrokerInfo();
+            this.MakeAssertionsForBroker(allInfo[1], 1, "192.168.0.1", 1234);
+            this.MakeAssertionsForBroker(allInfo[2], 2, "192.168.0.2", 3456);
+        }
+
+        [Test]
+        public void BrokerPartitionInfoGetPartitionInfo()
+        {
+            IBrokerPartitionInfo brokerPartitionInfo = new ConfigBrokerPartitionInfo(config);
+            var broker = brokerPartitionInfo.GetBrokerInfo(1);
+            this.MakeAssertionsForBroker(broker, 1, "192.168.0.1", 1234);
+        }
+
+        [Test]
+        public void BrokerPartitionInfoGetPartitionInfoReturnsNullOnNonexistingBrokerId()
+        {
+            IBrokerPartitionInfo brokerPartitionInfo = new ConfigBrokerPartitionInfo(config);
+            var broker = brokerPartitionInfo.GetBrokerInfo(45);
+            Assert.IsNull(broker);
+        }
+
+        private void MakeAssertionsForBroker(Broker broker, int expectedId, string expectedHost,
int expectedPort)
+        {
+            Assert.IsNotNull(broker);
+            Assert.AreEqual(expectedId, broker.Id);
+            Assert.AreEqual(expectedHost, broker.Host);
+            Assert.AreEqual(expectedPort, broker.Port);
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Properties/AssemblyInfo.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Properties/AssemblyInfo.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Properties/AssemblyInfo.cs
Wed Sep 21 19:17:19 2011
@@ -1,5 +1,4 @@
 using System.Reflection;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
 // General Information about an assembly is controlled through the following 

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/FetchRequestTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/FetchRequestTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/FetchRequestTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/FetchRequestTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,86 +1,75 @@
-using System;
-using System.Linq;
-using System.Text;
-using Kafka.Client.Request;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Request.Tests
-{
-    /// <summary>
-    /// Tests for the <see cref="FetchRequest"/> class.
-    /// </summary>
-    [TestFixture]
-    public class FetchRequestTests
-    {
-        /// <summary>
-        /// Tests a valid request.  
-        /// </summary>
-        [Test]
-        public void IsValidTrue()
-        {
-            FetchRequest request = new FetchRequest("topic", 1, 10L, 100);
-            Assert.IsTrue(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid request with no topic.
-        /// </summary>
-        [Test]
-        public void IsValidNoTopic()
-        {
-            FetchRequest request = new FetchRequest(" ", 1, 10L, 100);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid request with no topic.
-        /// </summary>
-        [Test]
-        public void IsValidNulltopic()
-        {
-            FetchRequest request = new FetchRequest(null, 1, 10L, 100);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests to ensure that the request follows the expected structure.
-        /// </summary>
-        [Test]
-        public void GetBytesValidStructure()
-        {
-            string topicName = "topic";
-            FetchRequest request = new FetchRequest(topicName, 1, 10L, 100);
-
-            // REQUEST TYPE ID + TOPIC LENGTH + TOPIC + PARTITION + OFFSET + MAX SIZE
-            int requestSize = 2 + 2 + topicName.Length + 4 + 8 + 4;
-
-            byte[] bytes = request.GetBytes();
-            Assert.IsNotNull(bytes);
-
-            // add 4 bytes for the length of the message at the beginning
-            Assert.AreEqual(requestSize + 4, bytes.Length);
-
-            // first 4 bytes = the message length
-            Assert.AreEqual(25, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
-
-            // next 2 bytes = the request type
-            Assert.AreEqual((short)RequestType.Fetch, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
-
-            // next 2 bytes = the topic length
-            Assert.AreEqual((short)topicName.Length, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
-
-            // next few bytes = the topic
-            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(topicName.Length).ToArray<byte>()));
-
-            // next 4 bytes = the partition
-            Assert.AreEqual(1, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(8 +
topicName.Length).Take(4).ToArray<byte>()), 0));
-
-            // next 8 bytes = the offset
-            Assert.AreEqual(10, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(12
+ topicName.Length).Take(8).ToArray<byte>()), 0));
-
-            // last 4 bytes = the max size
-            Assert.AreEqual(100, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(20
+ +topicName.Length).Take(4).ToArray<byte>()), 0));
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Request
+{
+    using System;
+    using System.IO;
+    using System.Linq;
+    using System.Text;
+    using Kafka.Client.Requests;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests for the <see cref="FetchRequest"/> class.
+    /// </summary>
+    [TestFixture]
+    public class FetchRequestTests
+    {
+        /// <summary>
+        /// Tests to ensure that the request follows the expected structure.
+        /// </summary>
+        [Test]
+        public void GetBytesValidStructure()
+        {
+            string topicName = "topic";
+            FetchRequest request = new FetchRequest(topicName, 1, 10L, 100);
+
+            // REQUEST TYPE ID + TOPIC LENGTH + TOPIC + PARTITION + OFFSET + MAX SIZE
+            int requestSize = 2 + 2 + topicName.Length + 4 + 8 + 4;
+
+            MemoryStream ms = new MemoryStream();
+            request.WriteTo(ms);
+            byte[] bytes = ms.ToArray();
+            Assert.IsNotNull(bytes);
+
+            // add 4 bytes for the length of the message at the beginning
+            Assert.AreEqual(requestSize + 4, bytes.Length);
+
+            // first 4 bytes = the message length
+            Assert.AreEqual(25, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
+
+            // next 2 bytes = the request type
+            Assert.AreEqual((short)RequestTypes.Fetch, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
+
+            // next 2 bytes = the topic length
+            Assert.AreEqual((short)topicName.Length, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
+
+            // next few bytes = the topic
+            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(topicName.Length).ToArray<byte>()));
+
+            // next 4 bytes = the partition
+            Assert.AreEqual(1, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(8 +
topicName.Length).Take(4).ToArray<byte>()), 0));
+
+            // next 8 bytes = the offset
+            Assert.AreEqual(10, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(12
+ topicName.Length).Take(8).ToArray<byte>()), 0));
+
+            // last 4 bytes = the max size
+            Assert.AreEqual(100, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(20
+ +topicName.Length).Take(4).ToArray<byte>()), 0));
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiFetchRequestTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiFetchRequestTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiFetchRequestTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiFetchRequestTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,86 +1,77 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Kafka.Client.Request;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Request.Tests
-{
-    /// <summary>
-    /// Tests for the <see cref="MultiFetchRequest"/> class.
-    /// </summary>
-    [TestFixture]
-    public class MultiFetchRequestTests
-    {
-        /// <summary>
-        /// Tests a valid multi-consumer request.
-        /// </summary>
-        [Test]
-        public void IsValidTrue()
-        {
-            List<FetchRequest> requests = new List<FetchRequest>
-            { 
-                new FetchRequest("topic a", 0, 0),
-                new FetchRequest("topic a", 0, 0),
-                new FetchRequest("topic b", 0, 0),
-                new FetchRequest("topic c", 0, 0)
-            };
-
-            MultiFetchRequest multiRequest = new MultiFetchRequest(requests);
-            Assert.IsTrue(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Tests for an invalid multi-request with no requests provided.
-        /// </summary>
-        [Test]
-        public void IsValidNoRequests()
-        {
-            MultiFetchRequest multiRequest = new MultiFetchRequest(new List<FetchRequest>());
-            Assert.IsFalse(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Tests for an invalid multi-request with no requests provided.
-        /// </summary>
-        [Test]
-        public void IsValidNullRequests()
-        {
-            MultiFetchRequest multiRequest = new MultiFetchRequest(null);
-            Assert.IsFalse(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
-        /// </summary>
-        [Test]
-        public void GetBytesValidFormat()
-        {
-            List<FetchRequest> requests = new List<FetchRequest>
-            { 
-                new FetchRequest("topic a", 0, 0),
-                new FetchRequest("topic a", 0, 0),
-                new FetchRequest("topic b", 0, 0),
-                new FetchRequest("topic c", 0, 0)
-            };
-
-            MultiFetchRequest request = new MultiFetchRequest(requests);
-
-            // format = len(request) + requesttype + requestcount + requestpackage
-            // total byte count = 4 + (2 + 2 + 100)
-            byte[] bytes = request.GetBytes();
-            Assert.IsNotNull(bytes);
-            Assert.AreEqual(108, bytes.Length);
-
-            // first 4 bytes = the length of the request
-            Assert.AreEqual(104, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
-
-            // next 2 bytes = the RequestType which in this case should be Produce
-            Assert.AreEqual((short)RequestType.MultiFetch, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
-
-            // next 2 bytes = the number of messages
-            Assert.AreEqual((short)4, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Request
+{
+    using System;
+    using System.Collections.Generic;
+    using System.IO;
+    using System.Linq;
+    using Kafka.Client.Requests;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests for the <see cref="MultiFetchRequest"/> class.
+    /// </summary>
+    [TestFixture]
+    public class MultiFetchRequestTests
+    {
+        /// <summary>
+        /// Tests for an invalid multi-request constructor with no requests given.
+        /// </summary>
+        [Test]
+        public void ThrowsExceptionWhenNullArgumentPassedToTheConstructor()
+        {
+            MultiFetchRequest multiRequest;
+            Assert.Throws<ArgumentNullException>(() => multiRequest = new MultiFetchRequest(null));
+        }
+
+        /// <summary>
+        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
+        /// </summary>
+        [Test]
+        public void GetBytesValidFormat()
+        {
+            List<FetchRequest> requests = new List<FetchRequest>
+            { 
+                new FetchRequest("topic a", 0, 0),
+                new FetchRequest("topic a", 0, 0),
+                new FetchRequest("topic b", 0, 0),
+                new FetchRequest("topic c", 0, 0)
+            };
+
+            MultiFetchRequest request = new MultiFetchRequest(requests);
+
+            // format = len(request) + requesttype + requestcount + requestpackage
+            // total byte count = 4 + (2 + 2 + 100)
+            MemoryStream ms = new MemoryStream();
+            request.WriteTo(ms);
+            byte[] bytes = ms.ToArray();
+            Assert.IsNotNull(bytes);
+            Assert.AreEqual(108, bytes.Length);
+
+            // first 4 bytes = the length of the request
+            Assert.AreEqual(104, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
+
+            // next 2 bytes = the RequestType which in this case should be Produce
+            Assert.AreEqual((short)RequestTypes.MultiFetch, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
+
+            // next 2 bytes = the number of messages
+            Assert.AreEqual((short)4, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiProducerRequestTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiProducerRequestTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiProducerRequestTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/MultiProducerRequestTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,86 +1,68 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Kafka.Client.Request;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Request.Tests
-{
-    /// <summary>
-    /// Tests for the <see cref="MultiProducerRequest"/> class.
-    /// </summary>
-    [TestFixture]
-    public class MultiProducerRequestTests
-    {
-        /// <summary>
-        /// Tests a valid multi-producer request.
-        /// </summary>
-        [Test]
-        public void IsValidTrue()
-        {
-            List<ProducerRequest> requests = new List<ProducerRequest>
-            { 
-                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic b", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic c", 0, new List<Message> { new Message(new
byte[10]) })
-            };
-
-            MultiProducerRequest multiRequest = new MultiProducerRequest(requests);
-            Assert.IsTrue(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Tests for an invalid multi-request with no requests provided.
-        /// </summary>
-        [Test]
-        public void IsValidNoRequests()
-        {
-            MultiProducerRequest multiRequest = new MultiProducerRequest(new List<ProducerRequest>());
-            Assert.IsFalse(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Tests for an invalid multi-request with no requests provided.
-        /// </summary>
-        [Test]
-        public void IsValidNullRequests()
-        {
-            MultiProducerRequest multiRequest = new MultiProducerRequest(null);
-            Assert.IsFalse(multiRequest.IsValid());
-        }
-
-        /// <summary>
-        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
-        /// </summary>
-        [Test]
-        public void GetBytesValidFormat()
-        {
-            List<ProducerRequest> requests = new List<ProducerRequest>
-            { 
-                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic b", 0, new List<Message> { new Message(new
byte[10]) }),
-                new ProducerRequest("topic c", 0, new List<Message> { new Message(new
byte[10]) })
-            };
-
-            MultiProducerRequest request = new MultiProducerRequest(requests);
-
-            // format = len(request) + requesttype + requestcount + requestpackage
-            // total byte count = 4 + (2 + 2 + 144)
-            byte[] bytes = request.GetBytes();
-            Assert.IsNotNull(bytes);
-            Assert.AreEqual(152, bytes.Length);
-
-            // first 4 bytes = the length of the request
-            Assert.AreEqual(148, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
-
-            // next 2 bytes = the RequestType which in this case should be Produce
-            Assert.AreEqual((short)RequestType.MultiProduce, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
-
-            // next 2 bytes = the number of messages
-            Assert.AreEqual((short)4, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Request
+{
+    using System;
+    using System.Collections.Generic;
+    using System.IO;
+    using System.Linq;
+    using Kafka.Client.Messages;
+    using Kafka.Client.Requests;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests for the <see cref="MultiProducerRequest"/> class.
+    /// </summary>
+    [TestFixture]
+    public class MultiProducerRequestTests
+    {
+        /// <summary>
+        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
+        /// </summary>
+        [Test]
+        public void WriteToValidFormat()
+        {
+            List<ProducerRequest> requests = new List<ProducerRequest>
+            { 
+                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
+                new ProducerRequest("topic a", 0, new List<Message> { new Message(new
byte[10]) }),
+                new ProducerRequest("topic b", 0, new List<Message> { new Message(new
byte[10]) }),
+                new ProducerRequest("topic c", 0, new List<Message> { new Message(new
byte[10]) })
+            };
+
+            MultiProducerRequest request = new MultiProducerRequest(requests);
+
+            // format = len(request) + requesttype + requestcount + requestpackage
+            // total byte count = 4 + (2 + 2 + 144)
+            MemoryStream ms = new MemoryStream();
+            request.WriteTo(ms);
+            byte[] bytes = ms.ToArray();
+            Assert.IsNotNull(bytes);
+            Assert.AreEqual(152, bytes.Length);
+
+            // first 4 bytes = the length of the request
+            Assert.AreEqual(148, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
+
+            // next 2 bytes = the RequestType which in this case should be Produce
+            Assert.AreEqual((short)RequestTypes.MultiProduce, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
+
+            // next 2 bytes = the number of messages
+            Assert.AreEqual((short)4, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/OffsetRequestTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/OffsetRequestTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/OffsetRequestTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/OffsetRequestTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,83 +1,72 @@
-using System;
-using System.Linq;
-using System.Text;
-using Kafka.Client.Request;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Request.Tests
-{
-    /// <summary>
-    /// Tests the <see cref="OffsetRequest"/> class.
-    /// </summary>
-    [TestFixture]
-    public class OffsetRequestTests
-    {
-        /// <summary>
-        /// Tests a valid request.  
-        /// </summary>
-        [Test]
-        public void IsValidTrue()
-        {
-            FetchRequest request = new FetchRequest("topic", 1, 10L, 100);
-            Assert.IsTrue(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid request with no topic.
-        /// </summary>
-        [Test]
-        public void IsValidNoTopic()
-        {
-            FetchRequest request = new FetchRequest(" ", 1, 10L, 100);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid request with no topic.
-        /// </summary>
-        [Test]
-        public void IsValidNulltopic()
-        {
-            FetchRequest request = new FetchRequest(null, 1, 10L, 100);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Validates the list of bytes meet Kafka expectations.
-        /// </summary>
-        [Test]
-        public void GetBytesValid()
-        {
-            string topicName = "topic";
-            OffsetRequest request = new OffsetRequest(topicName, 0, OffsetRequest.LatestTime,
10);
-
-            // format = len(request) + requesttype + len(topic) + topic + partition + time
+ max
-            // total byte count = 4 + (2 + 2 + 5 + 4 + 8 + 4)
-            byte[] bytes = request.GetBytes();
-            Assert.IsNotNull(bytes);
-            Assert.AreEqual(29, bytes.Length);
-
-            // first 4 bytes = the length of the request
-            Assert.AreEqual(25, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
-
-            // next 2 bytes = the RequestType which in this case should be Produce
-            Assert.AreEqual((short)RequestType.Offsets, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
-
-            // next 2 bytes = the length of the topic
-            Assert.AreEqual((short)5, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
-
-            // next 5 bytes = the topic
-            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(5).ToArray<byte>()));
-
-            // next 4 bytes = the partition
-            Assert.AreEqual(0, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(13).Take(4).ToArray<byte>()),
0));
-
-            // next 8 bytes = time
-            Assert.AreEqual(OffsetRequest.LatestTime, BitConverter.ToInt64(BitWorks.ReverseBytes(bytes.Skip(17).Take(8).ToArray<byte>()),
0));
-
-            // next 4 bytes = max offsets
-            Assert.AreEqual(10, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(25).Take(4).ToArray<byte>()),
0));
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Request
+{
+    using System;
+    using System.IO;
+    using System.Linq;
+    using System.Text;
+    using Kafka.Client.Requests;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests the <see cref="OffsetRequest"/> class.
+    /// </summary>
+    [TestFixture]
+    public class OffsetRequestTests
+    {
+        /// <summary>
+        /// Validates the list of bytes meet Kafka expectations.
+        /// </summary>
+        [Test]
+        public void GetBytesValid()
+        {
+            string topicName = "topic";
+            OffsetRequest request = new OffsetRequest(topicName, 0, OffsetRequest.LatestTime,
10);
+
+            // format = len(request) + requesttype + len(topic) + topic + partition + time
+ max
+            // total byte count = 4 + (2 + 2 + 5 + 4 + 8 + 4)
+            MemoryStream ms = new MemoryStream();
+            request.WriteTo(ms);
+            byte[] bytes = ms.ToArray();
+            Assert.IsNotNull(bytes);
+            Assert.AreEqual(29, bytes.Length);
+
+            // first 4 bytes = the length of the request
+            Assert.AreEqual(25, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
+
+            // next 2 bytes = the RequestType which in this case should be Produce
+            Assert.AreEqual((short)RequestTypes.Offsets, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
+
+            // next 2 bytes = the length of the topic
+            Assert.AreEqual((short)5, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
+
+            // next 5 bytes = the topic
+            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(5).ToArray<byte>()));
+
+            // next 4 bytes = the partition
+            Assert.AreEqual(0, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(13).Take(4).ToArray<byte>()),
0));
+
+            // next 8 bytes = time
+            Assert.AreEqual(OffsetRequest.LatestTime, BitConverter.ToInt64(BitWorks.ReverseBytes(bytes.Skip(17).Take(8).ToArray<byte>()),
0));
+
+            // next 4 bytes = max offsets
+            Assert.AreEqual(10, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(25).Take(4).ToArray<byte>()),
0));
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/ProducerRequestTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/ProducerRequestTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/ProducerRequestTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Request/ProducerRequestTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,86 +1,76 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Kafka.Client.Request;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Request.Tests
-{
-    /// <summary>
-    /// Tests for the <see cref="ProducerRequest"/> class.
-    /// </summary>
-    [TestFixture]
-    public class ProducerRequestTests
-    {
-        /// <summary>
-        /// Tests a valid producer request.
-        /// </summary>
-        [Test]
-        public void IsValidTrue()
-        {
-            ProducerRequest request = new ProducerRequest(
-                "topic", 0, new List<Message> { new Message(new byte[10]) });
-            Assert.IsTrue(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid producer request with no topic.
-        /// </summary>
-        [Test]
-        public void IsValidFalseNoTopic()
-        {
-            ProducerRequest request = new ProducerRequest(null, 0, null);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Tests a invalid producer request with no messages to send.
-        /// </summary>
-        [Test]
-        public void IsValidFalseNoMessages()
-        {
-            ProducerRequest request = new ProducerRequest("topic", 0, null);
-            Assert.IsFalse(request.IsValid());
-        }
-
-        /// <summary>
-        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
-        /// </summary>
-        [Test]
-        public void GetBytesValidFormat()
-        {
-            string topicName = "topic";
-            ProducerRequest request = new ProducerRequest(
-                topicName, 0, new List<Message> { new Message(new byte[10]) });
-
-            // format = len(request) + requesttype + len(topic) + topic + partition + len(messagepack)
+ message
-            // total byte count = 4 + (2 + 2 + 5 + 4 + 4 + 19)
-            byte[] bytes = request.GetBytes();
-            Assert.IsNotNull(bytes);
-            Assert.AreEqual(40, bytes.Length);
-
-            // first 4 bytes = the length of the request
-            Assert.AreEqual(36, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
-
-            // next 2 bytes = the RequestType which in this case should be Produce
-            Assert.AreEqual((short)RequestType.Produce, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
-
-            // next 2 bytes = the length of the topic
-            Assert.AreEqual((short)5, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
-
-            // next 5 bytes = the topic
-            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(5).ToArray<byte>()));
-
-            // next 4 bytes = the partition
-            Assert.AreEqual(0, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(13).Take(4).ToArray<byte>()),
0));
-
-            // next 4 bytes = the length of the individual messages in the pack
-            Assert.AreEqual(19, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(17).Take(4).ToArray<byte>()),
0));
-
-            // fianl bytes = the individual messages in the pack
-            Assert.AreEqual(19, bytes.Skip(21).ToArray<byte>().Length);
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Request
+{
+    using System;
+    using System.Collections.Generic;
+    using System.IO;
+    using System.Linq;
+    using System.Text;
+    using Kafka.Client.Messages;
+    using Kafka.Client.Requests;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests for the <see cref="ProducerRequest"/> class.
+    /// </summary>
+    [TestFixture]
+    public class ProducerRequestTests
+    {
+        /// <summary>
+        /// Test to ensure a valid format in the returned byte array as expected by Kafka.
+        /// </summary>
+        [Test]
+        public void WriteToValidFormat()
+        {
+            string topicName = "topic";
+            ProducerRequest request = new ProducerRequest(
+                topicName, 0, new List<Message> { new Message(new byte[10]) });
+
+            // format = len(request) + requesttype + len(topic) + topic + partition + len(messagepack)
+ message
+            // total byte count = (4 + 2 + 2 + 5 + 4 + 4 + 19)
+            System.IO.MemoryStream ms = new MemoryStream();
+            request.WriteTo(ms);
+
+            byte[] bytes = ms.ToArray();
+            Assert.IsNotNull(bytes);
+            Assert.AreEqual(40, bytes.Length);
+
+            // next 4 bytes = the length of the request
+            Assert.AreEqual(36, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Take(4).ToArray<byte>()),
0));
+
+            // next 2 bytes = the RequestType which in this case should be Produce
+            Assert.AreEqual((short)RequestTypes.Produce, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(4).Take(2).ToArray<byte>()),
0));
+
+            // next 2 bytes = the length of the topic
+            Assert.AreEqual((short)5, BitConverter.ToInt16(BitWorks.ReverseBytes(bytes.Skip(6).Take(2).ToArray<byte>()),
0));
+
+            // next 5 bytes = the topic
+            Assert.AreEqual(topicName, Encoding.ASCII.GetString(bytes.Skip(8).Take(5).ToArray<byte>()));
+
+            // next 4 bytes = the partition
+            Assert.AreEqual(0, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(13).Take(4).ToArray<byte>()),
0));
+
+            // next 4 bytes = the length of the individual messages in the pack
+            Assert.AreEqual(19, BitConverter.ToInt32(BitWorks.ReverseBytes(bytes.Skip(17).Take(4).ToArray<byte>()),
0));
+
+            // fianl bytes = the individual messages in the pack
+            Assert.AreEqual(19, bytes.Skip(21).ToArray<byte>().Length);
+        }
+    }
+}

Modified: incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Util/BitWorksTests.cs
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Util/BitWorksTests.cs?rev=1173797&r1=1173796&r2=1173797&view=diff
==============================================================================
--- incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Util/BitWorksTests.cs
(original)
+++ incubator/kafka/trunk/clients/csharp/src/Kafka/Tests/Kafka.Client.Tests/Util/BitWorksTests.cs
Wed Sep 21 19:17:19 2011
@@ -1,104 +1,120 @@
-using System;
-using Kafka.Client.Util;
-using NUnit.Framework;
-
-namespace Kafka.Client.Tests.Util
-{
-    /// <summary>
-    /// Tests for <see cref="BitWorks"/> utility class.
-    /// </summary>
-    [TestFixture]
-    public class BitWorksTests
-    {
-        /// <summary>
-        /// Ensures bytes are returned reversed.
-        /// </summary>
-        [Test]
-        public void GetBytesReversedShortValid()
-        {
-            short val = (short)100;
-            byte[] normal = BitConverter.GetBytes(val);
-            byte[] reversed = BitWorks.GetBytesReversed(val);
-
-            TestReversedArray(normal, reversed);
-        }
-
-        /// <summary>
-        /// Ensures bytes are returned reversed.
-        /// </summary>
-        [Test]
-        public void GetBytesReversedIntValid()
-        {
-            int val = 100;
-            byte[] normal = BitConverter.GetBytes(val);
-            byte[] reversed = BitWorks.GetBytesReversed(val);
-
-            TestReversedArray(normal, reversed);
-        }
-
-        /// <summary>
-        /// Ensures bytes are returned reversed.
-        /// </summary>
-        [Test]
-        public void GetBytesReversedLongValid()
-        {
-            long val = 100L;
-            byte[] normal = BitConverter.GetBytes(val);
-            byte[] reversed = BitWorks.GetBytesReversed(val);
-
-            TestReversedArray(normal, reversed);
-        }
-
-        /// <summary>
-        /// Null array will reverse to a null.
-        /// </summary>
-        [Test]
-        public void ReverseBytesNullArray()
-        {
-            byte[] arr = null;
-            Assert.IsNull(BitWorks.ReverseBytes(arr));
-        }
-
-        /// <summary>
-        /// Zero length array will reverse to a zero length array.
-        /// </summary>
-        [Test]
-        public void ReverseBytesZeroLengthArray()
-        {
-            byte[] arr = new byte[0];
-            byte[] reversedArr = BitWorks.ReverseBytes(arr);
-            Assert.IsNotNull(reversedArr);
-            Assert.AreEqual(0, reversedArr.Length);
-        }
-
-        /// <summary>
-        /// Array is reversed.
-        /// </summary>
-        [Test]
-        public void ReverseBytesValid()
-        {
-            byte[] arr = BitConverter.GetBytes((short)1);
-            byte[] original = new byte[2];
-            arr.CopyTo(original, 0);
-            byte[] reversedArr = BitWorks.ReverseBytes(arr);
-
-            TestReversedArray(original, reversedArr);
-        }
-
-        /// <summary>
-        /// Performs asserts for two arrays that should be exactly the same, but values
-        /// in one are in reverse order of the other.
-        /// </summary>
-        /// <param name="normal">The "normal" array.</param>
-        /// <param name="reversed">The array that is in reverse order to the "normal"
one.</param>
-        private static void TestReversedArray(byte[] normal, byte[] reversed)
-        {
-            Assert.IsNotNull(reversed);
-            Assert.AreEqual(normal.Length, reversed.Length);
-            for (int ix = 0; ix < normal.Length; ix++)
-            {
-                Assert.AreEqual(normal[ix], reversed[reversed.Length - 1 - ix]);
-            }
-        }
-    }
-}
+/*
+ * Copyright 2011 LinkedIn
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+namespace Kafka.Client.Tests.Util
+{
+    using System;
+    using Kafka.Client.Utils;
+    using NUnit.Framework;
+
+    /// <summary>
+    /// Tests for <see cref="BitWorks"/> utility class.
+    /// </summary>
+    [TestFixture]
+    public class BitWorksTests
+    {
+        /// <summary>
+        /// Ensures bytes are returned reversed.
+        /// </summary>
+        [Test]
+        public void GetBytesReversedShortValid()
+        {
+            short val = (short)100;
+            byte[] normal = BitConverter.GetBytes(val);
+            byte[] reversed = BitWorks.GetBytesReversed(val);
+
+            TestReversedArray(normal, reversed);
+        }
+
+        /// <summary>
+        /// Ensures bytes are returned reversed.
+        /// </summary>
+        [Test]
+        public void GetBytesReversedIntValid()
+        {
+            int val = 100;
+            byte[] normal = BitConverter.GetBytes(val);
+            byte[] reversed = BitWorks.GetBytesReversed(val);
+
+            TestReversedArray(normal, reversed);
+        }
+
+        /// <summary>
+        /// Ensures bytes are returned reversed.
+        /// </summary>
+        [Test]
+        public void GetBytesReversedLongValid()
+        {
+            long val = 100L;
+            byte[] normal = BitConverter.GetBytes(val);
+            byte[] reversed = BitWorks.GetBytesReversed(val);
+
+            TestReversedArray(normal, reversed);
+        }
+
+        /// <summary>
+        /// Null array will reverse to a null.
+        /// </summary>
+        [Test]
+        public void ReverseBytesNullArray()
+        {
+            byte[] arr = null;
+            Assert.IsNull(BitWorks.ReverseBytes(arr));
+        }
+
+        /// <summary>
+        /// Zero length array will reverse to a zero length array.
+        /// </summary>
+        [Test]
+        public void ReverseBytesZeroLengthArray()
+        {
+            byte[] arr = new byte[0];
+            byte[] reversedArr = BitWorks.ReverseBytes(arr);
+            Assert.IsNotNull(reversedArr);
+            Assert.AreEqual(0, reversedArr.Length);
+        }
+
+        /// <summary>
+        /// Array is reversed.
+        /// </summary>
+        [Test]
+        public void ReverseBytesValid()
+        {
+            byte[] arr = BitConverter.GetBytes((short)1);
+            byte[] original = new byte[2];
+            arr.CopyTo(original, 0);
+            byte[] reversedArr = BitWorks.ReverseBytes(arr);
+
+            TestReversedArray(original, reversedArr);
+        }
+
+        /// <summary>
+        /// Performs asserts for two arrays that should be exactly the same, but values
+        /// in one are in reverse order of the other.
+        /// </summary>
+        /// <param name="normal">The "normal" array.</param>
+        /// <param name="reversed">The array that is in reverse order to the "normal"
one.</param>
+        private static void TestReversedArray(byte[] normal, byte[] reversed)
+        {
+            Assert.IsNotNull(reversed);
+            Assert.AreEqual(normal.Length, reversed.Length);
+            for (int ix = 0; ix < normal.Length; ix++)
+            {
+                Assert.AreEqual(normal[ix], reversed[reversed.Length - 1 - ix]);
+            }
+        }
+    }
+}



Mime
View raw message