logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpsen...@apache.org
Subject svn commit: r1520538 - in /logging/log4net/trunk/tests/src: Appender/AppenderCollectionTest.cs log4net.Tests.vs2003.csproj log4net.Tests.vs2008.csproj log4net.Tests.vs2010.csproj
Date Fri, 06 Sep 2013 11:07:31 GMT
Author: dpsenner
Date: Fri Sep  6 11:07:31 2013
New Revision: 1520538

URL: http://svn.apache.org/r1520538
Log:
LOG4NET-390 added test cases that test the appender collection ToArray() method

Added:
    logging/log4net/trunk/tests/src/Appender/AppenderCollectionTest.cs
Modified:
    logging/log4net/trunk/tests/src/log4net.Tests.vs2003.csproj
    logging/log4net/trunk/tests/src/log4net.Tests.vs2008.csproj
    logging/log4net/trunk/tests/src/log4net.Tests.vs2010.csproj

Added: logging/log4net/trunk/tests/src/Appender/AppenderCollectionTest.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/Appender/AppenderCollectionTest.cs?rev=1520538&view=auto
==============================================================================
--- logging/log4net/trunk/tests/src/Appender/AppenderCollectionTest.cs (added)
+++ logging/log4net/trunk/tests/src/Appender/AppenderCollectionTest.cs Fri Sep  6 11:07:31
2013
@@ -0,0 +1,65 @@
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more 
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership. 
+// The ASF licenses this file to you 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.
+//
+#endregion
+
+using log4net.Appender;
+using NUnit.Framework;
+
+namespace log4net.Tests.Appender
+{
+	/// <summary>
+	/// Used for internal unit testing the <see cref="AppenderCollection"/> class.
+	/// </summary>
+	/// <remarks>
+	/// Used for internal unit testing the <see cref="AppenderCollection"/> class.
+	/// </remarks>
+	/// <author>Carlos Muñoz</author>
+	[TestFixture]
+	public class AppenderCollectionTest
+	{
+		/// <summary>
+		/// Verifies that ToArray returns the elements of the <see cref="AppenderCollection"/>
+		/// </summary>
+		[Test]
+		public void ToArrayTest()
+		{
+			AppenderCollection appenderCollection = new AppenderCollection();
+			IAppender appender = new MemoryAppender();
+			appenderCollection.Add(appender);
+
+			IAppender[] appenderArray = appenderCollection.ToArray();
+
+			Assert.AreEqual(1, appenderArray.Length);
+			Assert.AreEqual(appender, appenderArray[0]);
+		}
+
+		[Test]
+		public void ReadOnlyToArrayTest()
+		{
+			AppenderCollection appenderCollection = new AppenderCollection();
+			IAppender appender = new MemoryAppender();
+			appenderCollection.Add(appender);
+			AppenderCollection readonlyAppenderCollection = AppenderCollection.ReadOnly(appenderCollection);
+
+			IAppender[] appenderArray = readonlyAppenderCollection.ToArray();
+
+			Assert.AreEqual(1, appenderArray.Length);
+			Assert.AreEqual(appender, appenderArray[0]);
+		}
+	}
+}
\ No newline at end of file

Modified: logging/log4net/trunk/tests/src/log4net.Tests.vs2003.csproj
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/log4net.Tests.vs2003.csproj?rev=1520538&r1=1520537&r2=1520538&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/log4net.Tests.vs2003.csproj (original)
+++ logging/log4net/trunk/tests/src/log4net.Tests.vs2003.csproj Fri Sep  6 11:07:31 2013
@@ -137,6 +137,11 @@
                     BuildAction = "Compile"
                 />
                 <File
+                    RelPath = "Appender\AppenderCollectionTest.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
                     RelPath = "Appender\AdoNetAppenderTest.cs"
                     SubType = "Code"
                     BuildAction = "Compile"

Modified: logging/log4net/trunk/tests/src/log4net.Tests.vs2008.csproj
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/log4net.Tests.vs2008.csproj?rev=1520538&r1=1520537&r2=1520538&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/log4net.Tests.vs2008.csproj (original)
+++ logging/log4net/trunk/tests/src/log4net.Tests.vs2008.csproj Fri Sep  6 11:07:31 2013
@@ -123,6 +123,7 @@
     <Compile Include="Appender\AdoNet\Log4NetParameter.cs" />
     <Compile Include="Appender\AdoNet\Log4NetParameterCollection.cs" />
     <Compile Include="Appender\AdoNet\Log4NetTransaction.cs" />
+    <Compile Include="Appender\AppenderCollectionTest.cs" />
     <Compile Include="Appender\BufferingAppenderTest.cs">
       <SubType>Code</SubType>
     </Compile>

Modified: logging/log4net/trunk/tests/src/log4net.Tests.vs2010.csproj
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/tests/src/log4net.Tests.vs2010.csproj?rev=1520538&r1=1520537&r2=1520538&view=diff
==============================================================================
--- logging/log4net/trunk/tests/src/log4net.Tests.vs2010.csproj (original)
+++ logging/log4net/trunk/tests/src/log4net.Tests.vs2010.csproj Fri Sep  6 11:07:31 2013
@@ -140,6 +140,7 @@
     <Compile Include="Appender\AdoNet\Log4NetParameter.cs" />
     <Compile Include="Appender\AdoNet\Log4NetParameterCollection.cs" />
     <Compile Include="Appender\AdoNet\Log4NetTransaction.cs" />
+    <Compile Include="Appender\AppenderCollectionTest.cs" />
     <Compile Include="Appender\BufferingAppenderTest.cs">
       <SubType>Code</SubType>
     </Compile>



Mime
View raw message