├── Build ├── clean.bat ├── SimianConsole.exe ├── NCoverReportUpdater.exe ├── testfast.bat ├── SimianConsole.exe.config ├── LogicEngine.ncover ├── LogicEngine.xml └── simian.xsl ├── src ├── Example │ ├── Readme.txt │ ├── packages.config │ ├── ExampleModel.cs │ ├── ExampleEngine.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── AddRule.cs │ └── Example.csproj ├── Example.Test │ ├── Readme.txt │ ├── packages.config │ ├── ExampleEngine.Test.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Example.Test.csproj ├── LogicEngine.Lib │ ├── packages.config │ ├── Formatters │ │ ├── IResultsFormatter.cs │ │ ├── NoopFormatter.cs │ │ └── CsvResultsFormatter.cs │ ├── IRule.cs │ ├── RuleCollection.cs │ ├── PreRunRule.cs │ ├── EngineResult.cs │ ├── LogicEngine.Lib.nuspec │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Engine.cs │ └── LogicEngine.Lib.csproj ├── LogicEngine.Lib.Test │ ├── TestObjects │ │ ├── IOtherInterface.cs │ │ ├── BadModel.cs │ │ ├── TestModel.cs │ │ ├── FailModel.cs │ │ ├── Fail.cs │ │ ├── Add.cs │ │ └── Subtract.cs │ ├── packages.config │ ├── EngineResultTest.cs │ ├── RuleBaseTest.cs │ ├── PreRunRuleTest.cs │ ├── PrintResultsFormatterTest.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── EngineTest.cs │ └── LogicEngine.Lib.Test.csproj └── NuGet.Test │ ├── packages.config │ ├── UnitTest1.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── NuGet.Test.csproj ├── .gitignore ├── README.md ├── LogicEngine.sln ├── LICENSE └── .vs └── config └── applicationhost.config /Build/clean.bat: -------------------------------------------------------------------------------- 1 | msbuild LogicEngine.xml /t:Clean 2 | -------------------------------------------------------------------------------- /src/Example/Readme.txt: -------------------------------------------------------------------------------- 1 | This is an example LogicEngine usage -------------------------------------------------------------------------------- /src/Example.Test/Readme.txt: -------------------------------------------------------------------------------- 1 | Tests of the LogicEngine implementation -------------------------------------------------------------------------------- /Build/SimianConsole.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevFoundries/LogicEngine/HEAD/Build/SimianConsole.exe -------------------------------------------------------------------------------- /src/LogicEngine.Lib/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Build/NCoverReportUpdater.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevFoundries/LogicEngine/HEAD/Build/NCoverReportUpdater.exe -------------------------------------------------------------------------------- /Build/testfast.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | msbuild LogicEngine.xml /t:BuildCommon;AddEnableCoverage;TestOnly;SimianReport;GetCoverageReport -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/IOtherInterface.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test 2 | { 3 | interface IOtherInterface 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/BadModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test 2 | { 3 | public class BadModel 4 | { 5 | public int Noop { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/NuGet.Test/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Build/SimianConsole.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/TestModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test.TestObjects 2 | { 3 | public class TestModel 4 | { 5 | public int A { get; set; } 6 | public int B { get; set; } 7 | public double Result { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /src/NuGet.Test/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace NuGet.Test 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/Formatters/IResultsFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace LogicEngine.Lib.Formatters 5 | { 6 | public interface IResultsFormatter 7 | { 8 | void OutputResults(IList results, TimeSpan totalTime); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/IRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LogicEngine.Lib 8 | { 9 | public interface IRule where T : class 10 | { 11 | IEngineResult Execute(T model); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/FailModel.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test 2 | { 3 | public class FailModel : IRule, IOtherInterface 4 | { 5 | public IEngineResult Execute(BadModel model) 6 | { 7 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 8 | return result; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/Fail.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test.TestObjects 2 | { 3 | public class Fail: IOtherInterface 4 | { 5 | public IEngineResult Execute(TestModel model) 6 | { 7 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 8 | model.Result = model.A * 4 - model.B; 9 | return result; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Example/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Example.Test/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/Add.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test.TestObjects 2 | { 3 | public class Add : IRule, IOtherInterface 4 | { 5 | public IEngineResult Execute(TestModel model) 6 | { 7 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 8 | model.Result = model.A + model.B; 9 | return result; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/TestObjects/Subtract.cs: -------------------------------------------------------------------------------- 1 | namespace LogicEngine.Lib.Test.TestObjects 2 | { 3 | public class Subtract : IRule, IOtherInterface 4 | { 5 | public IEngineResult Execute(TestModel model) 6 | { 7 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 8 | model.Result = model.A*4 - model.B; 9 | return result; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/LogicEngine.Lib/Formatters/NoopFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LogicEngine.Lib.Formatters 8 | { 9 | // This formatter will do nothing. It's super useful :) 10 | public class NoopFormatter : IResultsFormatter 11 | { 12 | public void OutputResults(IList results, TimeSpan totalTime) 13 | { 14 | // noop 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/RuleCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace LogicEngine.Lib 11 | { 12 | public interface IRuleCollection : IList> where T : class 13 | { 14 | } 15 | 16 | public class RuleCollection : List>, IRuleCollection where T : class 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Example/ExampleModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Example 8 | { 9 | public class ExampleModel 10 | { 11 | public int Value1 { get; set; } 12 | public int Value2 { get; set; } 13 | public int AddResult { get; set; } 14 | public int SubtractResult { get; set; } 15 | public int MultiplicaionResult { get; set; } 16 | public float DivisionResult { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/EngineResultTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace LogicEngine.Lib.Test 5 | { 6 | [TestClass] 7 | public class EngineResultTest 8 | { 9 | [TestMethod] 10 | public void ConstructorTest() 11 | { 12 | IEngineResult result = new EngineResult() { Error = "error", Message = "Message" }.End(); 13 | Assert.IsNotNull(result); 14 | Assert.IsNotNull(result.Error); 15 | Assert.IsNotNull(result.Message); 16 | Assert.IsNotNull(result.TimeEnd); 17 | Assert.IsNotNull(result.TimeStart); 18 | Assert.IsNotNull(result.Elapsed); 19 | Assert.IsTrue(result.HasError); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Example/ExampleEngine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using LogicEngine.Lib; 7 | 8 | namespace Example 9 | { 10 | public class ExampleEngine 11 | { 12 | public IList Run(ExampleModel model) 13 | { 14 | Engine engine = new Engine( 15 | new RuleCollection() 16 | { 17 | new AddRule(), 18 | new DivisionRule(), 19 | new MultiplicationRule(), 20 | new SubtractRule() 21 | }) {RunBumperRules = true}; 22 | var retval = engine.Execute(model); 23 | return retval; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/PreRunRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace LogicEngine.Lib 8 | { 9 | public class PreRunRule : IRule where T: class 10 | { 11 | public IEngineResult Execute(T model) 12 | { 13 | IEngineResult result = new EngineResult(); 14 | result.Message = this.GetType() + " :: Start "; 15 | return result; 16 | } 17 | } 18 | 19 | public class PostRunRule : IRule where T : class 20 | { 21 | public IEngineResult Execute(T model) 22 | { 23 | IEngineResult result = new EngineResult(); 24 | result.Message = this.GetType() + " :: End "; 25 | return result; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/RuleBaseTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace LogicEngine.Lib.Test 5 | { 6 | [TestClass] 7 | public class RuleBaseTest 8 | { 9 | [TestMethod] 10 | public void PreRunTest() 11 | { 12 | PreRunRule ruleBase = new PreRunRule(); 13 | Assert.IsNotNull(ruleBase); 14 | var result = ruleBase.Execute("blah"); 15 | Assert.IsNotNull(result); 16 | Assert.IsTrue(result.Message.Contains("PreRun")); 17 | 18 | } 19 | 20 | [TestMethod] 21 | public void PostTest() 22 | { 23 | PostRunRule ruleBase = new PostRunRule(); 24 | ruleBase.Execute("blah"); 25 | var result = ruleBase.Execute("blah"); 26 | Assert.IsNotNull(result); 27 | Assert.IsTrue(result.Message.Contains("PostRun")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/PreRunRuleTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | 8 | namespace LogicEngine.Lib.Test 9 | { 10 | [TestClass] 11 | public class PreRunRuleTest 12 | { 13 | 14 | [TestMethod] 15 | public void ConstructorTest() 16 | { 17 | var rule = new PreRunRule(); 18 | var result = rule.Execute("noop"); 19 | Assert.IsNotNull(result); 20 | Assert.IsNotNull(result.TimeStart); 21 | Assert.IsNotNull(result.TimeEnd); 22 | } 23 | } 24 | 25 | [TestClass] 26 | public class PostRunRuleTest 27 | { 28 | 29 | [TestMethod] 30 | public void ConstructorTest() 31 | { 32 | var rule = new PostRunRule(); 33 | var result = rule.Execute("noop"); 34 | Assert.IsNotNull(result); 35 | Assert.IsNotNull(result.TimeStart); 36 | Assert.IsNotNull(result.TimeEnd); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/Formatters/CsvResultsFormatter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace LogicEngine.Lib.Formatters 6 | { 7 | public interface ICsvResultsFormatter : IResultsFormatter 8 | { 9 | string Output { get; } 10 | } 11 | 12 | public class CsvResultsFormatter : ICsvResultsFormatter 13 | { 14 | public string Output { get; private set; } 15 | 16 | 17 | public void OutputResults(IList results, TimeSpan runElapsed) 18 | { 19 | var format = "{0},{1},{2},{3},{4},{5},{6}\r\n"; 20 | StringBuilder sb = new StringBuilder(); 21 | sb.AppendLine("Run Elapsed Total Time: " + runElapsed); 22 | sb.AppendFormat(format, "RuleName", "Start", "Stop", "Elapsed", "HasError","Message" ,"ErrorMessage"); 23 | foreach (var result in results) 24 | { 25 | sb.AppendFormat(format, result.Name, result.TimeStart,result.TimeEnd, result.Elapsed, result.HasError, result.Message,result.Error); 26 | } 27 | this.Output = sb.ToString(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/PrintResultsFormatterTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using LogicEngine.Lib.Formatters; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace LogicEngine.Lib.Test 7 | { 8 | [TestClass] 9 | public class PrintResultsFormatterTest 10 | { 11 | [TestMethod] 12 | public void ConstructorTest() 13 | { 14 | var formatter = new CsvResultsFormatter(); 15 | Assert.IsNotNull(formatter); 16 | } 17 | 18 | [TestMethod] 19 | public void OutputTest() 20 | { 21 | IList list = new List(); 22 | list.Add(new EngineResult() { Name = "Name 1" }.End()); 23 | list.Add(new EngineResult() { Name = "Name 2" }.End()); 24 | list.Add(new EngineResult() { Name = "Name 3" }.End()); 25 | list.Add(new EngineResult() { Name = "Name 4" }.End()); 26 | list.Add(new EngineResult() { Name = "Name 5" }.End()); 27 | var formatter = new CsvResultsFormatter(); 28 | formatter.OutputResults(list,new TimeSpan(0,0,0,4,100)); 29 | Assert.IsNotNull(formatter.Output); 30 | Assert.IsInstanceOfType(formatter.Output, typeof(string)); 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Example.Test/ExampleEngine.Test.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using LogicEngine.Lib; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | 8 | namespace Example.Test 9 | { 10 | [TestClass] 11 | public class ExampleEngineTest 12 | { 13 | [TestMethod] 14 | public void ConstructorTest() 15 | { 16 | ExampleEngine engine = new ExampleEngine(); 17 | Assert.IsNotNull(engine); 18 | } 19 | 20 | [TestMethod] 21 | public void RunTest() 22 | { 23 | ExampleEngine engine = new ExampleEngine(); 24 | var model = new ExampleModel() {Value1 = 1, Value2 = 2}; 25 | IList results = engine.Run(model); 26 | Assert.AreEqual(3,model.AddResult); 27 | Assert.AreEqual(2, model.MultiplicaionResult); 28 | Assert.AreEqual(0.5, model.DivisionResult); 29 | Assert.AreEqual(-1,model.SubtractResult); 30 | Assert.IsTrue(results.First().Message.Contains("PreRun")); 31 | Assert.IsTrue(results.Last().Message.Contains("PostRun")); 32 | TimeSpan elapsed = results.First().TimeStart - results.Last().TimeEnd; // the bumper rules have the start/stop times. 33 | Assert.IsNotNull(elapsed); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/EngineResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Security.Cryptography.X509Certificates; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace LogicEngine.Lib 10 | { 11 | public interface IEngineResult 12 | { 13 | string Name { get; set; } 14 | bool HasError { get; } 15 | string Error { get; set; } 16 | string Message { get; set; } 17 | DateTime TimeStart { get; } 18 | DateTime TimeEnd { get; } 19 | TimeSpan Elapsed { get; } 20 | IEngineResult End(); 21 | } 22 | 23 | public class EngineResult : IEngineResult 24 | { 25 | public EngineResult() 26 | { 27 | } 28 | 29 | public bool HasError => !string.IsNullOrEmpty(Error); 30 | 31 | public string Name { get; set; } 32 | public string Error { get; set; } 33 | public string Message { get; set; } 34 | public DateTime TimeStart { get; } = DateTime.UtcNow; 35 | public DateTime TimeEnd { get; private set; } 36 | public TimeSpan Elapsed { get; private set; } 37 | 38 | public IEngineResult End() 39 | { 40 | this.TimeEnd = DateTime.UtcNow; 41 | this.Elapsed = this.TimeStart - this.TimeEnd; 42 | return this; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/LogicEngine.Lib.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LogicEngine.Lib 5 | 2.1.0.0 6 | LogicEngine.Lib 7 | wbsimms 8 | wbsimms 9 | https://github.com/wbsimms/LogicEngine/blob/develop/LICENSE 10 | https://github.com/wbsimms/LogicEngine 11 | http://wbsimms.com/wp-content/uploads/2014/10/WBS_200px-icon1.png 12 | false 13 | Logic engine is designed to run arbitrary rules or bits of logic against a given model 14 | Release 2.1 15 | Copyright 2017 16 | Logic Rules Engine 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Example/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Example")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Example")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c3808efa-a542-4ea0-95ad-b75a28bbca2f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/NuGet.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NuGet.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NuGet.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7fec5f3d-c3fc-47df-87e9-aa74e01ed86b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Example.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Example.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Example.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8625d275-46de-4b42-bda1-9dddaaf7ee74")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LogicEngine.Lib.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("LogicEngine.Lib.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("705c1223-e866-4ac4-8cec-349dde08a5ec")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Example/AddRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using LogicEngine.Lib; 8 | 9 | namespace Example 10 | { 11 | public class AddRule : IRule 12 | { 13 | public IEngineResult Execute(ExampleModel model) 14 | { 15 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 16 | model.AddResult = model.Value1 + model.Value2; 17 | return result; 18 | } 19 | } 20 | 21 | class SubtractRule : IRule 22 | { 23 | public IEngineResult Execute(ExampleModel model) 24 | { 25 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 26 | model.SubtractResult = model.Value1 - model.Value2; 27 | return result; 28 | } 29 | } 30 | 31 | class MultiplicationRule : IRule 32 | { 33 | public IEngineResult Execute(ExampleModel model) 34 | { 35 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 36 | model.MultiplicaionResult = model.Value1 * model.Value2; 37 | return result; 38 | } 39 | } 40 | 41 | class DivisionRule : IRule 42 | { 43 | public IEngineResult Execute(ExampleModel model) 44 | { 45 | EngineResult result = new EngineResult() { Name = GetType().ToString()}; 46 | model.DivisionResult = (float)model.Value1 / model.Value2; 47 | return result; 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LogicEngine.Lib")] 9 | [assembly: AssemblyDescription("Logic engine is designed to run arbitrary rules or bits of logic against a given model")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Wm. Barrett Simms")] 12 | [assembly: AssemblyProduct("LogicEngine.Lib")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0d709753-2adb-42e6-8969-5ba1c1e6677b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.*")] 36 | [assembly: AssemblyFileVersion("2.0.0.0")] 37 | -------------------------------------------------------------------------------- /Build/LogicEngine.ncover: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "LogicEngine", 3 | "Config": { 4 | "sequencePtCvgThreshold": 91.0, 5 | "branchCvgThreshold": 86.5, 6 | "conditionCvgThreshold": 62.2, 7 | "complexityThreshold": 11.0, 8 | "satComplexityThreshold": 95.0, 9 | "crappyMethodThreshold": 10.0, 10 | "crapThreshold": 12.0, 11 | "isCodeCentralProject": false, 12 | "enabled": true, 13 | "aggregateEnabled": true, 14 | "mergeMode": "None", 15 | "logLevel": "None", 16 | "visibility": "Private", 17 | "syncWithCC": true, 18 | "mergeAppDomains": true, 19 | "name": "LogicEngine", 20 | "matchRules": [ 21 | { 22 | "matchData": "QTAgent32.*\\.exe", 23 | "type": "Regex" 24 | } 25 | ], 26 | "preCoverageFilter": { 27 | "id": "CDE47D72FD70823FCD96BB19055B60DE20E90615", 28 | "name": null, 29 | "description": null, 30 | "serverFilter": false, 31 | "filterRules": [ 32 | { 33 | "include": true, 34 | "field": "Module", 35 | "condition": "Matches", 36 | "value": "LogicEngine.Lib.dll", 37 | "serverRule": false 38 | }, 39 | { 40 | "include": true, 41 | "field": "Module", 42 | "condition": "Matches", 43 | "value": "Example.dll", 44 | "serverRule": false 45 | }, 46 | { 47 | "include": false, 48 | "field": "Attribute", 49 | "condition": "Matches", 50 | "value": "System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage", 51 | "serverRule": false 52 | }, 53 | { 54 | "include": false, 55 | "field": "Attribute", 56 | "condition": "Matches", 57 | "value": "System.Runtime.CompilerServices.CompilerGeneratedAttribute", 58 | "serverRule": false 59 | }, 60 | { 61 | "include": false, 62 | "field": "Attribute", 63 | "condition": "Matches", 64 | "value": "System.CodeDom.Compiler.GeneratedCodeAttribute", 65 | "serverRule": false 66 | } 67 | ] 68 | }, 69 | "postCoverageFilters": [], 70 | "enabledOnCC": true 71 | } 72 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | [Rr]eleases/ 14 | x64/ 15 | x86/ 16 | build/ 17 | bld/ 18 | [Bb]in/ 19 | [Oo]bj/ 20 | 21 | # Roslyn cache directories 22 | *.ide/ 23 | 24 | # MSTest test Results 25 | [Tt]est[Rr]esult*/ 26 | [Bb]uild[Ll]og.* 27 | 28 | #NUNIT 29 | *.VisualState.xml 30 | TestResult.xml 31 | 32 | # Build Results of an ATL Project 33 | [Dd]ebugPS/ 34 | [Rr]eleasePS/ 35 | dlldata.c 36 | 37 | *_i.c 38 | *_p.c 39 | *_i.h 40 | *.ilk 41 | *.meta 42 | *.obj 43 | *.pch 44 | *.pdb 45 | *.pgc 46 | *.pgd 47 | *.rsp 48 | *.sbr 49 | *.tlb 50 | *.tli 51 | *.tlh 52 | *.tmp 53 | *.tmp_proj 54 | *.log 55 | *.vspscc 56 | *.vssscc 57 | .builds 58 | *.pidb 59 | *.svclog 60 | *.scc 61 | 62 | # Chutzpah Test files 63 | _Chutzpah* 64 | 65 | # Visual C++ cache files 66 | ipch/ 67 | *.aps 68 | *.ncb 69 | *.opensdf 70 | *.sdf 71 | *.cachefile 72 | 73 | # Visual Studio profiler 74 | *.psess 75 | *.vsp 76 | *.vspx 77 | 78 | # TFS 2012 Local Workspace 79 | $tf/ 80 | 81 | # Guidance Automation Toolkit 82 | *.gpState 83 | 84 | # ReSharper is a .NET coding add-in 85 | _ReSharper*/ 86 | *.[Rr]e[Ss]harper 87 | *.DotSettings.user 88 | 89 | # JustCode is a .NET coding addin-in 90 | .JustCode 91 | 92 | # TeamCity is a build add-in 93 | _TeamCity* 94 | 95 | # DotCover is a Code Coverage Tool 96 | *.dotCover 97 | 98 | # NCrunch 99 | _NCrunch_* 100 | .*crunch*.local.xml 101 | 102 | # MightyMoose 103 | *.mm.* 104 | AutoTest.Net/ 105 | 106 | # Web workbench (sass) 107 | .sass-cache/ 108 | 109 | # Installshield output folder 110 | [Ee]xpress/ 111 | 112 | # DocProject is a documentation generator add-in 113 | DocProject/buildhelp/ 114 | DocProject/Help/*.HxT 115 | DocProject/Help/*.HxC 116 | DocProject/Help/*.hhc 117 | DocProject/Help/*.hhk 118 | DocProject/Help/*.hhp 119 | DocProject/Help/Html2 120 | DocProject/Help/html 121 | 122 | # Click-Once directory 123 | publish/ 124 | 125 | # Publish Web Output 126 | *.[Pp]ublish.xml 127 | *.azurePubxml 128 | # TODO: Comment the next line if you want to checkin your web deploy settings 129 | # but database connection strings (with potential passwords) will be unencrypted 130 | *.pubxml 131 | *.publishproj 132 | 133 | # NuGet Packages 134 | *.nupkg 135 | # The packages folder can be ignored because of Package Restore 136 | **/packages/* 137 | # except build/, which is used as an MSBuild target. 138 | !**/packages/build/ 139 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 140 | #!**/packages/repositories.config 141 | 142 | # Windows Azure Build Output 143 | csx/ 144 | *.build.csdef 145 | 146 | # Windows Store app package directory 147 | AppPackages/ 148 | 149 | # Others 150 | sql/ 151 | *.Cache 152 | ClientBin/ 153 | [Ss]tyle[Cc]op.* 154 | ~$* 155 | *~ 156 | *.dbmdl 157 | *.dbproj.schemaview 158 | *.pfx 159 | *.publishsettings 160 | node_modules/ 161 | 162 | # RIA/Silverlight projects 163 | Generated_Code/ 164 | 165 | # Backup & report files from converting an old project file 166 | # to a newer Visual Studio version. Backup files are not needed, 167 | # because we have git ;-) 168 | _UpgradeReport_Files/ 169 | Backup*/ 170 | UpgradeLog*.XML 171 | UpgradeLog*.htm 172 | 173 | # SQL Server files 174 | *.mdf 175 | *.ldf 176 | 177 | # Business Intelligence projects 178 | *.rdl.data 179 | *.bim.layout 180 | *.bim_*.settings 181 | 182 | # Microsoft Fakes 183 | FakesAssemblies/ 184 | -------------------------------------------------------------------------------- /Build/LogicEngine.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ..\LogicEngine.sln 4 | simian-2.4.0.exe 5 | ..\src\LogicEngine.Lib.Test\bin\Debug\LogicEngine.Lib.Test.dll 6 | ..\src\Example.Test\bin\Debug\Example.Test.dll 7 | /testcontainer:$(LogicEngineLib) /testcontainer:$(Example) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | $(SolutionRoot)\Bin\ 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | $(SolutionRoot)\Bin\ 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/Engine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using LogicEngine.Lib.Formatters; 8 | 9 | namespace LogicEngine.Lib 10 | { 11 | public interface IEngine 12 | where T: class 13 | { 14 | IList Execute(T model); 15 | IList Execute(T model, IEnumerable excludeRules, IEnumerable onlyRules); 16 | void ValidateContraints(IEnumerable excludeRules); 17 | 18 | bool RunBumperRules { get; set; } 19 | TimeSpan RunElapsed { get; } 20 | } 21 | 22 | public class Engine : IEngine 23 | where T : class 24 | { 25 | private IRuleCollection rules; 26 | private IResultsFormatter formatter; 27 | private IList results = new List(); 28 | 29 | public bool RunBumperRules { get; set; } 30 | public TimeSpan RunElapsed { get; private set; } 31 | 32 | public Engine(IRuleCollection rules, IResultsFormatter resultFormatter = null) 33 | { 34 | this.rules = rules; 35 | this.formatter = resultFormatter; 36 | if (formatter == null) 37 | formatter = new NoopFormatter(); 38 | } 39 | 40 | public IList Execute(T model, IEnumerable excludeRules, IEnumerable onlyRules) 41 | { 42 | ValidateContraints(excludeRules); 43 | ValidateContraints(onlyRules); 44 | this.RunElapsed = new TimeSpan(0, 0, 0, 0, 0); 45 | 46 | if (RunBumperRules) 47 | { 48 | this.results.Add(new PreRunRule().Execute(model).End()); 49 | } 50 | 51 | 52 | foreach (IRule rule in rules) 53 | { 54 | if (excludeRules != null || onlyRules != null) 55 | { 56 | var shouldRunModel = new ShouldRunRuleModel() 57 | { 58 | ExcludeRules = excludeRules, 59 | OnlyRules = onlyRules, 60 | ShouldRunRule = true, 61 | RuleInQuestion = rule.GetType() 62 | }; 63 | this.ShouldRunEngine.Execute(shouldRunModel); 64 | if (!shouldRunModel.ShouldRunRule) continue; 65 | } 66 | this.results.Add(rule.Execute(model)?.End()); 67 | } 68 | 69 | if (RunBumperRules) 70 | { 71 | this.results.Add(new PostRunRule().Execute(model).End()); 72 | this.RunElapsed = this.results.First().TimeStart - this.results.Last().TimeEnd; 73 | } 74 | formatter?.OutputResults(results, this.RunElapsed); 75 | return this.results; 76 | } 77 | 78 | public void ValidateContraints(IEnumerable rulesToValidate) 79 | { 80 | var valRules = rulesToValidate?.ToList(); 81 | if (valRules == null || !valRules.Any()) return; 82 | var checkType = typeof(IRule); 83 | var i = valRules.SelectMany(x => x.GetInterfaces()); 84 | if (!i.Contains(checkType)) 85 | { 86 | throw new ArgumentException("Exclude and Only rule parameters must all implement the IRule interface"); 87 | } 88 | } 89 | 90 | 91 | public IList Execute(T model) 92 | { 93 | return this.Execute(model, null, null); 94 | } 95 | 96 | public IEngine ShouldRunEngine 97 | { 98 | get 99 | { 100 | return new Engine(new RuleCollection() 101 | { 102 | new IsExcludedRule(), 103 | new RunOnlyRule() 104 | }); 105 | } 106 | } 107 | } 108 | 109 | public class ShouldRunRuleModel 110 | { 111 | public bool ShouldRunRule { get; set; } 112 | public Type RuleInQuestion { get; set; } 113 | public IEnumerable ExcludeRules { get; set; } 114 | public IEnumerable OnlyRules { get; set; } 115 | } 116 | 117 | public class IsExcludedRule : IRule { 118 | public IEngineResult Execute(ShouldRunRuleModel model) 119 | { 120 | if (model.ExcludeRules == null || model.OnlyRules != null) 121 | { 122 | return null; 123 | } 124 | if (model.ExcludeRules.Contains(model.RuleInQuestion)) 125 | { 126 | model.ShouldRunRule = false; 127 | } 128 | return null; 129 | } 130 | } 131 | 132 | public class RunOnlyRule : IRule 133 | { 134 | public IEngineResult Execute(ShouldRunRuleModel model) 135 | { 136 | if (model.OnlyRules == null) 137 | { 138 | return null; 139 | } 140 | 141 | model.ShouldRunRule = model.OnlyRules.Contains(model.RuleInQuestion); 142 | return null; 143 | } 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/NuGet.Test/NuGet.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B} 7 | Library 8 | Properties 9 | NuGet.Test 10 | NuGet.Test 11 | v4.6.2 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | ..\..\packages\LogicEngine.Lib.2.1.0\lib\net46\LogicEngine.Lib.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | False 68 | 69 | 70 | False 71 | 72 | 73 | False 74 | 75 | 76 | False 77 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | -------------------------------------------------------------------------------- /src/Example/Example.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {65B84CCD-3FAD-4234-A6F7-33628E589C48} 8 | Library 9 | Properties 10 | Example 11 | Example 12 | v4.6.2 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | 26 | 27 | pdbonly 28 | true 29 | bin\ 30 | TRACE 31 | prompt 32 | 4 33 | true 34 | 35 | 36 | 37 | ..\..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll 38 | True 39 | 40 | 41 | ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 42 | True 43 | 44 | 45 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll 46 | True 47 | 48 | 49 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll 50 | True 51 | 52 | 53 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll 54 | True 55 | 56 | 57 | ..\..\packages\Moq.4.5.29\lib\net45\Moq.dll 58 | True 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D} 80 | LogicEngine.Lib 81 | 82 | 83 | 84 | 85 | 86 | 87 | 94 | -------------------------------------------------------------------------------- /Build/simian.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
10 |

Summary

11 |

Report generated by 12 | Similarity Analyser 13 | 14 | .

15 |

Copyright (c) 2003-2013 Simon Harris. All rights reserved.s

16 |

Simian is not free unless used solely for non-commercial or evaluation purposes.

17 |
18 | 19 | 20 | 21 | 22 | 23 |
24 |

Duplications

25 | 26 | 27 | 28 | 29 |
30 |
31 | 32 | 33 |
34 | 35 | 36 |

Files

37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 63 | 66 | 67 | 68 |
File NameDuplications
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | , 56 | 57 | 58 | 59 | 60 | 61 | 62 | 64 | 65 |
69 |
70 | 71 | 72 |
73 | 74 |

Duplication: lines 75 |

76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 87 | 91 | 92 | 93 |
FileLocation
85 | 86 | 88 | - 89 | 90 |
94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 |
Similarity threshold (lines)
Total number of duplicate lines
Total number of duplicate blocks
Total number of files with duplicates 114 | 115 |
Total number of files
Total number of significant lines
% Duplication
130 |
131 | 132 | 133 | 134 | a 135 | b 136 | 137 | 138 | 139 |
140 | 141 | 142 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib/LogicEngine.Lib.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D} 8 | Library 9 | Properties 10 | LogicEngine.Lib 11 | LogicEngine.Lib 12 | v4.6.2 13 | 512 14 | ..\..\ 15 | true 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | true 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\net46\ 32 | TRACE 33 | prompt 34 | 4 35 | true 36 | v4.6.2 37 | 38 | 39 | pdbonly 40 | true 41 | bin\Release\net40\ 42 | TRACE 43 | prompt 44 | 4 45 | true 46 | v4.0 47 | 48 | 49 | pdbonly 50 | true 51 | bin\Release\net45\ 52 | TRACE 53 | prompt 54 | 4 55 | true 56 | v4.5 57 | 58 | 59 | 60 | False 61 | ..\..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.dll 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | Designer 85 | 86 | 87 | Designer 88 | 89 | 90 | 91 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/EngineTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using LogicEngine.Lib.Formatters; 4 | using LogicEngine.Lib.Test.TestObjects; 5 | using Microsoft.Practices.Unity; 6 | using Microsoft.VisualStudio.TestTools.UnitTesting; 7 | 8 | namespace LogicEngine.Lib.Test 9 | { 10 | [TestClass] 11 | public class EngineTest 12 | { 13 | [TestMethod] 14 | public void ConstructorTest() 15 | { 16 | Engine engine = new Engine(null); 17 | Assert.IsNotNull(engine); 18 | } 19 | 20 | [TestMethod] 21 | public void ExecuteTest() 22 | { 23 | Engine engine = new Engine(new RuleCollection()); 24 | var result = engine.Execute("blah"); 25 | Assert.IsNotNull(result); 26 | } 27 | 28 | [TestMethod] 29 | public void RunBumpersTest() 30 | { 31 | Engine engine = new Engine(new RuleCollection()) { RunBumperRules = true }; 32 | var result = engine.Execute("blah"); 33 | Assert.IsNotNull(result); 34 | Assert.AreEqual(2, result.Count); 35 | Assert.IsNotNull(engine.RunElapsed); 36 | Assert.IsTrue(engine.RunElapsed < TimeSpan.FromMilliseconds(100)); 37 | } 38 | 39 | [TestMethod] 40 | public void RunWithFormaterTest() 41 | { 42 | var formatter = new CsvResultsFormatter(); 43 | Engine engine = new Engine(new RuleCollection(), formatter) { RunBumperRules = true }; 44 | var result = engine.Execute("blah"); 45 | Assert.IsNotNull(result); 46 | Assert.AreEqual(2, result.Count); 47 | Assert.IsNotNull(engine.RunElapsed); 48 | Assert.IsNotNull(formatter.Output); 49 | Assert.IsTrue(engine.RunElapsed < TimeSpan.FromMilliseconds(100)); 50 | 51 | } 52 | 53 | [TestMethod] 54 | public void ExecuteViaUnity() 55 | { 56 | UnityContainer container = new UnityContainer(); 57 | container.RegisterType,Engine>(); 58 | container.RegisterType(); 59 | IRuleCollection coll = new RuleCollection(); 60 | container.RegisterInstance(coll); 61 | var engine = container.Resolve>(); 62 | Assert.IsNotNull(engine); 63 | } 64 | 65 | [TestMethod] 66 | public void ValidateContraintTest() 67 | { 68 | UnityContainer container = new UnityContainer(); 69 | container.RegisterType, Engine>(); 70 | IRuleCollection coll = new RuleCollection(); 71 | container.RegisterType(); 72 | coll.Add(new Add()); 73 | coll.Add(new Subtract()); 74 | container.RegisterInstance(coll); 75 | var engine = container.Resolve>(); 76 | engine.ValidateContraints(new List() 77 | { 78 | typeof(Subtract) 79 | }); 80 | } 81 | 82 | [TestMethod] 83 | [ExpectedException(typeof(ArgumentException),AllowDerivedTypes = false)] 84 | public void ValidateContraintFailTest() 85 | { 86 | UnityContainer container = new UnityContainer(); 87 | container.RegisterType, Engine>(); 88 | IRuleCollection coll = new RuleCollection(); 89 | container.RegisterType(); 90 | coll.Add(new Add()); 91 | coll.Add(new Subtract()); 92 | container.RegisterInstance(coll); 93 | var engine = container.Resolve>(); 94 | engine.ValidateContraints(new List() 95 | { 96 | typeof(Fail) 97 | }); 98 | } 99 | 100 | [TestMethod] 101 | public void ValidateContraintNoopTest() 102 | { 103 | UnityContainer container = new UnityContainer(); 104 | container.RegisterType, Engine>(); 105 | IRuleCollection coll = new RuleCollection(); 106 | container.RegisterType(); 107 | coll.Add(new Add()); 108 | coll.Add(new Subtract()); 109 | container.RegisterInstance(coll); 110 | var engine = container.Resolve>(); 111 | engine.ValidateContraints(null); 112 | } 113 | 114 | 115 | [TestMethod] 116 | [ExpectedException(typeof(ArgumentException), AllowDerivedTypes = false)] 117 | public void ValidateContraintFailModelTypeTest() 118 | { 119 | UnityContainer container = new UnityContainer(); 120 | container.RegisterType, Engine>(); 121 | IRuleCollection coll = new RuleCollection(); 122 | container.RegisterType(); 123 | coll.Add(new Add()); 124 | coll.Add(new Subtract()); 125 | container.RegisterInstance(coll); 126 | var engine = container.Resolve>(); 127 | engine.ValidateContraints(new List() 128 | { 129 | typeof(FailModel) 130 | }); 131 | } 132 | 133 | [TestMethod] 134 | public void ExcludeRuleTest() 135 | { 136 | UnityContainer container = new UnityContainer(); 137 | container.RegisterType, Engine>(); 138 | IRuleCollection coll = new RuleCollection(); 139 | container.RegisterType(); 140 | coll.Add(new Add()); 141 | coll.Add(new Subtract()); 142 | container.RegisterInstance(coll); 143 | var engine = container.Resolve>(); 144 | var model = new TestModel() {A = 2, B = 4}; 145 | var results = engine.Execute(model, new List() {typeof(Subtract)}, null); 146 | Assert.AreEqual(1, results.Count,0,"Rule count not correct."); // only one rule should run 147 | Assert.AreEqual(6,model.Result); 148 | 149 | } 150 | 151 | [TestMethod] 152 | public void OnlyRuleTest() 153 | { 154 | UnityContainer container = new UnityContainer(); 155 | container.RegisterType, Engine>(); 156 | IRuleCollection coll = new RuleCollection(); 157 | container.RegisterType(); 158 | coll.Add(new Add()); 159 | coll.Add(new Subtract()); 160 | container.RegisterInstance(coll); 161 | var engine = container.Resolve>(); 162 | var model = new TestModel() { A = 2, B = 4 }; 163 | var results = engine.Execute(model, null, new List() { typeof(Subtract) }); 164 | Assert.AreEqual(1, results.Count); // only one rule should run 165 | Assert.AreEqual(4, model.Result); 166 | } 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![LogicEngine Status](https://ci.appveyor.com/api/projects/status/github/wbsimms/logicengine?svg=true) 3 | 4 | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/wbsimms?utm_source=github&utm_medium=button&utm_term=wbsimms&utm_campaign=github) 5 | 6 | LogicEngine 7 | =========== 8 | 9 | LogicEngine is designed to run arbitrary rules or bits of logic against a given model. It's written in C# .NET 4.6.2 and supports: 10 | - .NET 4.0 11 | - .NET 4.5 12 | - .NET 4.6+ 13 | 14 | This project is born out of a DRY (don't repeat yourself) mentality. In other words, I was using the same code on several projects. 15 | 16 | How to use 17 | ----------- 18 | 19 | The source code has a working example (ExampleEngine) which shows how easy the logic engine is to use. The steps to use LogicEngine are as follows: 20 | 1. Create your business model 21 | ```C# 22 | public class ExampleModel 23 | { 24 | public int Value1 { get; set; } 25 | public int Value2 { get; set; } 26 | public int AddResult { get; set; } 27 | public int SubtractResult { get; set; } 28 | public int MultiplicaionResult { get; set; } 29 | public float DivisionResult { get; set; } 30 | } 31 | ``` 32 | 2. Create rules which implement IRule\ 33 | ```c# 34 | public class AddRule : IRule 35 | { 36 | public IEngineResult Execute(ExampleModel model) 37 | { 38 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 39 | model.AddResult = model.Value1 + model.Value2; 40 | return result; 41 | } 42 | } 43 | ``` 44 | 3. Add the rules to the rule collection 45 | 4. Create the engine with the collection 46 | 5. Execute the engine with your business model 47 | 48 | ```c# 49 | Engine engine = new Engine( 50 | new RuleCollection() 51 | { 52 | new AddRule(), 53 | new DivisionRule(), 54 | new MultiplicationRule(), 55 | new SubtractRule() 56 | }) {RunBumperRules = true}; 57 | var retval = engine.Execute(model); 58 | ``` 59 | 60 | The engine has the following interface: 61 | ```c# 62 | public interface IEngine 63 | where T: class 64 | { 65 | IList Execute(T model); 66 | bool RunBumperRules { get; set; } 67 | TimeSpan RunElapsed { get; } 68 | } 69 | ``` 70 | RunBumperRulles will insert PreRun and PostRun rules as the first and last rules. These are used to determine RunElapsed timespan. 71 | 72 | The engine returns a list of IEngineResult: 73 | ```c# 74 | public interface IEngineResult 75 | { 76 | string Name { get; set; } 77 | bool HasError { get; } 78 | string Error { get; set; } 79 | string Message { get; set; } 80 | DateTime TimeStart { get; } 81 | DateTime TimeEnd { get; } 82 | TimeSpan Elapsed { get; } 83 | IEngineResult End(); // You should never need to call this. 84 | } 85 | ``` 86 | Each IEngineResult will return the Elapsed TimeSpan. It's your reponsiblity to set Name, Error, and Message. 87 | 88 | API 89 | ----------- 90 | 91 | The only real requirement is to implement the IRule interface: 92 | 93 | ```c# 94 | public interface IRule where T : class 95 | { 96 | IEngineResult Execute(T model); 97 | } 98 | ``` 99 | 100 | In the ExampleEngine, the AddRule class looks like this: 101 | 102 | ```c# 103 | public class AddRule : IRule 104 | { 105 | public IEngineResult Execute(ExampleModel model) 106 | { 107 | EngineResult result = new EngineResult() { Name = GetType().ToString() }; 108 | model.AddResult = model.Value1 + model.Value2; 109 | return result; 110 | } 111 | } 112 | ``` 113 | The EngineResult class can be implemented, or you can use your own. The Engine returns a list of EngineResults. You can add any information you'd like. 114 | 115 | Once the rules are created, you only need to create an engine with them and execute the rules against the model. 116 | 117 | ```c# 118 | public IList Run(ExampleModel model) 119 | { 120 | Engine engine = new Engine( 121 | new RuleCollection() 122 | { 123 | new AddRule(), 124 | new DivisionRule(), 125 | new MultiplicationRule(), 126 | new SubtractRule() 127 | }) {RunBumperRules = true}; 128 | var retval = engine.Execute(model); 129 | return retval; 130 | } 131 | ``` 132 | 133 | Bumper Rules 134 | ------------ 135 | The engine has some "bumper rules". They're rules that run before/after all your rules. They will give you run start/stop times. 136 | 137 | ```c# 138 | new Engine(someListOfRules) {RunBumperRules = true;} 139 | ``` 140 | 141 | Results Formatter 142 | ------------ 143 | The engine has support for formatting the list of IEngineResults. There are two provided formatters: 144 | 1. NoopFormatter 145 | This formatter does nothing. It's the default formatter if you don't provide one. 146 | 2. CsvFormatter 147 | This formatter returns a CSV list of the results. NOTE: The first row will the total elapsed run time. 148 | 149 | ```c# 150 | public Engine(IRuleCollection rules, IResultsFormatter resultFormatter = null) 151 | ``` 152 | The only requirement to implement your own formatter is to implement the IResultsFormatter interface as seen in the CsvResultsFormatter: 153 | ```c# 154 | public interface IResultsFormatter 155 | { 156 | void OutputResults(IList results, TimeSpan totalTime); 157 | } 158 | 159 | public class CsvResultsFormatter : ICsvResultsFormatter 160 | { 161 | public string Output { get; private set; } 162 | public void OutputResults(IList results, TimeSpan runElapsed) 163 | { 164 | var format = "{0},{1},{2},{3},{4},{5},{6}\r\n"; 165 | StringBuilder sb = new StringBuilder(); 166 | sb.AppendLine("Run Elapsed Total Time: " + runElapsed); 167 | sb.AppendFormat(format, "RuleName", "Start", "Stop", "Elapsed", "HasError","Message" ,"ErrorMessage"); 168 | foreach (var result in results) 169 | { 170 | sb.AppendFormat(format, result.Name, result.TimeStart,result.TimeEnd, result.Elapsed, result.HasError, result.Message,result.Error); 171 | } 172 | this.Output = sb.ToString(); 173 | } 174 | } 175 | ``` 176 | 177 | Dependency Injection Support 178 | ----------- 179 | You can use dependency injection to add your rules. Simply add them to the RulesCollection. 180 | 181 | ```c# 182 | UnityContainer container = new UnityContainer(); 183 | container.RegisterType,Engine>(); 184 | container.RegisterType(); 185 | IRuleCollection coll = new RuleCollection(); 186 | container.RegisterInstance(coll); 187 | var engine = container.Resolve>(); 188 | Assert.IsNotNull(engine); 189 | ``` 190 | 191 | ## Feature Requests ## 192 | [![Feature Requests](http://feathub.com/wbsimms/LogicEngine?format=svg)](http://feathub.com/wbsimms/LogicEngine) 193 | -------------------------------------------------------------------------------- /src/Example.Test/Example.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1} 7 | Library 8 | Properties 9 | Example.Test 10 | Example.Test 11 | v4.6.2 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | true 30 | 31 | 32 | pdbonly 33 | true 34 | bin\ 35 | TRACE 36 | prompt 37 | 4 38 | true 39 | 40 | 41 | 42 | ..\..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll 43 | True 44 | 45 | 46 | ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 47 | True 48 | 49 | 50 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll 51 | True 52 | 53 | 54 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll 55 | True 56 | 57 | 58 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll 59 | True 60 | 61 | 62 | ..\..\packages\Moq.4.5.29\lib\net45\Moq.dll 63 | True 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | {65B84CCD-3FAD-4234-A6F7-33628E589C48} 89 | Example 90 | 91 | 92 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D} 93 | LogicEngine.Lib 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | False 104 | 105 | 106 | False 107 | 108 | 109 | False 110 | 111 | 112 | False 113 | 114 | 115 | 116 | 117 | 118 | 119 | 126 | -------------------------------------------------------------------------------- /src/LogicEngine.Lib.Test/LogicEngine.Lib.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A} 7 | Library 8 | Properties 9 | LogicEngine.Lib.Test 10 | LogicEngine.Lib.Test 11 | v4.6.2 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | ..\ 20 | true 21 | 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | true 32 | 33 | 34 | pdbonly 35 | true 36 | bin\ 37 | TRACE 38 | prompt 39 | 4 40 | true 41 | 42 | 43 | 44 | ..\..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll 45 | True 46 | 47 | 48 | ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 49 | True 50 | 51 | 52 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.dll 53 | True 54 | 55 | 56 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.Configuration.dll 57 | True 58 | 59 | 60 | ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll 61 | True 62 | 63 | 64 | ..\..\packages\Moq.4.5.29\lib\net45\Moq.dll 65 | True 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | False 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | {65B84CCD-3FAD-4234-A6F7-33628E589C48} 101 | Example 102 | 103 | 104 | {d11a7227-d7cb-4a35-80c6-7357d1410a8d} 105 | LogicEngine.Lib 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | False 117 | 118 | 119 | False 120 | 121 | 122 | False 123 | 124 | 125 | False 126 | 127 | 128 | 129 | 130 | 131 | 132 | 139 | -------------------------------------------------------------------------------- /LogicEngine.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogicEngine.Lib", "src\LogicEngine.Lib\LogicEngine.Lib.csproj", "{D11A7227-D7CB-4A35-80C6-7357D1410A8D}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogicEngine.Lib.Test", "src\LogicEngine.Lib.Test\LogicEngine.Lib.Test.csproj", "{684FB3AC-47A8-4F4B-820E-C97E07E1036A}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{7117B338-0A0D-4713-BE23-1F6F2C636866}" 11 | ProjectSection(SolutionItems) = preProject 12 | Build\LogicEngine.ncover = Build\LogicEngine.ncover 13 | Build\LogicEngine.xml = Build\LogicEngine.xml 14 | Build\testfast.bat = Build\testfast.bat 15 | EndProjectSection 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "src\Example\Example.csproj", "{65B84CCD-3FAD-4234-A6F7-33628E589C48}" 18 | EndProject 19 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.Test", "src\Example.Test\Example.Test.csproj", "{6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}" 20 | EndProject 21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{10AA5126-C21E-43B9-9178-ECF23E8F3469}" 22 | ProjectSection(SolutionItems) = preProject 23 | README.md = README.md 24 | EndProjectSection 25 | EndProject 26 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Test", "src\NuGet.Test\NuGet.Test.csproj", "{7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}" 27 | EndProject 28 | Global 29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 30 | Debug|Any CPU = Debug|Any CPU 31 | Debug|ARM = Debug|ARM 32 | Debug|x64 = Debug|x64 33 | Debug|x86 = Debug|x86 34 | Release|Any CPU = Release|Any CPU 35 | Release|ARM = Release|ARM 36 | Release|x64 = Release|x64 37 | Release|x86 = Release|x86 38 | EndGlobalSection 39 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 40 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|ARM.ActiveCfg = Debug|Any CPU 43 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|ARM.Build.0 = Debug|Any CPU 44 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|x64.ActiveCfg = Debug|Any CPU 45 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|x64.Build.0 = Debug|Any CPU 46 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|x86.ActiveCfg = Debug|Any CPU 47 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Debug|x86.Build.0 = Debug|Any CPU 48 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|Any CPU.ActiveCfg = Release 4.5|Any CPU 49 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|Any CPU.Build.0 = Release 4.5|Any CPU 50 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|ARM.ActiveCfg = Release 4.0|Any CPU 51 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|ARM.Build.0 = Release 4.0|Any CPU 52 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|x64.ActiveCfg = Release 4.0|Any CPU 53 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|x64.Build.0 = Release 4.0|Any CPU 54 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|x86.ActiveCfg = Release 4.0|Any CPU 55 | {D11A7227-D7CB-4A35-80C6-7357D1410A8D}.Release|x86.Build.0 = Release 4.0|Any CPU 56 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|ARM.ActiveCfg = Debug|Any CPU 59 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|ARM.Build.0 = Debug|Any CPU 60 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|x64.ActiveCfg = Debug|Any CPU 61 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|x64.Build.0 = Debug|Any CPU 62 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|x86.ActiveCfg = Debug|Any CPU 63 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Debug|x86.Build.0 = Debug|Any CPU 64 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|ARM.ActiveCfg = Release|Any CPU 67 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|ARM.Build.0 = Release|Any CPU 68 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|x64.ActiveCfg = Release|Any CPU 69 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|x64.Build.0 = Release|Any CPU 70 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|x86.ActiveCfg = Release|Any CPU 71 | {684FB3AC-47A8-4F4B-820E-C97E07E1036A}.Release|x86.Build.0 = Release|Any CPU 72 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 73 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|Any CPU.Build.0 = Debug|Any CPU 74 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|ARM.ActiveCfg = Debug|Any CPU 75 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|ARM.Build.0 = Debug|Any CPU 76 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|x64.ActiveCfg = Debug|Any CPU 77 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|x64.Build.0 = Debug|Any CPU 78 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|x86.ActiveCfg = Debug|Any CPU 79 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Debug|x86.Build.0 = Debug|Any CPU 80 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|Any CPU.ActiveCfg = Release|Any CPU 81 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|Any CPU.Build.0 = Release|Any CPU 82 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|ARM.ActiveCfg = Release|Any CPU 83 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|ARM.Build.0 = Release|Any CPU 84 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|x64.ActiveCfg = Release|Any CPU 85 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|x64.Build.0 = Release|Any CPU 86 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|x86.ActiveCfg = Release|Any CPU 87 | {65B84CCD-3FAD-4234-A6F7-33628E589C48}.Release|x86.Build.0 = Release|Any CPU 88 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 89 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|Any CPU.Build.0 = Debug|Any CPU 90 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|ARM.ActiveCfg = Debug|Any CPU 91 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|ARM.Build.0 = Debug|Any CPU 92 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|x64.ActiveCfg = Debug|Any CPU 93 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|x64.Build.0 = Debug|Any CPU 94 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|x86.ActiveCfg = Debug|Any CPU 95 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Debug|x86.Build.0 = Debug|Any CPU 96 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|Any CPU.ActiveCfg = Release|Any CPU 97 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|Any CPU.Build.0 = Release|Any CPU 98 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|ARM.ActiveCfg = Release|Any CPU 99 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|ARM.Build.0 = Release|Any CPU 100 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|x64.ActiveCfg = Release|Any CPU 101 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|x64.Build.0 = Release|Any CPU 102 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|x86.ActiveCfg = Release|Any CPU 103 | {6B84895F-0C48-4CEA-8B34-66CE2B0F1BF1}.Release|x86.Build.0 = Release|Any CPU 104 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 105 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|Any CPU.Build.0 = Debug|Any CPU 106 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|ARM.ActiveCfg = Debug|Any CPU 107 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|ARM.Build.0 = Debug|Any CPU 108 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|x64.ActiveCfg = Debug|Any CPU 109 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|x64.Build.0 = Debug|Any CPU 110 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|x86.ActiveCfg = Debug|Any CPU 111 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Debug|x86.Build.0 = Debug|Any CPU 112 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|Any CPU.ActiveCfg = Release|Any CPU 113 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|Any CPU.Build.0 = Release|Any CPU 114 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|ARM.ActiveCfg = Release|Any CPU 115 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|ARM.Build.0 = Release|Any CPU 116 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|x64.ActiveCfg = Release|Any CPU 117 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|x64.Build.0 = Release|Any CPU 118 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|x86.ActiveCfg = Release|Any CPU 119 | {7FEC5F3D-C3FC-47DF-87E9-AA74E01ED86B}.Release|x86.Build.0 = Release|Any CPU 120 | EndGlobalSection 121 | GlobalSection(SolutionProperties) = preSolution 122 | HideSolutionNode = FALSE 123 | EndGlobalSection 124 | EndGlobal 125 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /.vs/config/applicationhost.config: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 50 | 51 | 52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | 61 | 62 | 63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |
83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 | 91 |
92 |
93 |
94 |
95 |
96 | 97 |
98 |
99 |
100 | 101 |
102 |
103 | 104 |
105 |
106 | 107 |
108 |
109 |
110 | 111 | 112 |
113 |
114 |
115 |
116 |
117 |
118 | 119 |
120 |
121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | --------------------------------------------------------------------------------