lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] NightOwl888 commented on a change in pull request #287: Implemenation of "System Properties" in .NET (addresses #254)
Date Wed, 20 May 2020 03:35:22 GMT

NightOwl888 commented on a change in pull request #287:
URL: https://github.com/apache/lucenenet/pull/287#discussion_r427722562



##########
File path: src/Lucene.Net.Tests.TestFramework/Configuration/TestSystemProperties.cs
##########
@@ -0,0 +1,94 @@
+´╗┐using Lucene.Net.Search;
+using Lucene.Net.Util;
+using Microsoft.Extensions.Configuration;
+using Microsoft.VisualBasic.CompilerServices;
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using System.Text;
+
+namespace Lucene.Net.Configuration
+{
+
+
+    [TestFixture]
+    class TestSystemProperties : LuceneTestCase
+    {
+
+        //[OneTimeSetUp]
+        //public override void BeforeClass()
+        //{
+        //    ConfigurationFactory = new TestConfigurationFactory();
+        //    base.BeforeClass();
+        //}
+        [Test]
+        public virtual void EnvironmentTest2()
+        {
+            string testKey = "lucene:tests:setting";
+            string testValue = "test.success";
+            Lucene.Net.Configuration.ConfigurationSettings.CurrentConfiguration[testKey]
= testValue;
+            Assert.AreEqual(Lucene.Net.Configuration.ConfigurationSettings.CurrentConfiguration[testKey],
testValue);
+        }
+        [Test]
+        public virtual void SetTest()
+        {
+            Assert.AreEqual("fr", Lucene.Net.Configuration.ConfigurationSettings.CurrentConfiguration["tests:locale"]);
+            Lucene.Net.Configuration.ConfigurationSettings.CurrentConfiguration["tests:locale"]
= "en";
+            Assert.AreEqual("en", Lucene.Net.Configuration.ConfigurationSettings.CurrentConfiguration["tests:locale"]);

Review comment:
       For testing of internal types, we can add `InternalsVisibleTo`. We've set up MSBuild
to generate the attribute, so all it requires is to add the following line to the [`Lucene.Net.csproj`
file](https://github.com/apache/lucenenet/blob/master/src/Lucene.Net/Lucene.Net.csproj#L134):
   
   ```xml
   <InternalsVisibleTo Include="Lucene.Net.Tests.TestFramework" />
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message