Cache result of GetLowerBound in Array.Sort(Array, Array) (#1296)

--- src/System.Private.CoreLib/src/System/Array.cs
+++ src/System.Private.CoreLib/src/System/Array.cs
@@ -1815,11 +1815,12 @@
                 throw new ArgumentNullException("keys");
             if (keys.Rank != 1 || (items != null && items.Rank != 1))
                 throw new RankException(SR.Rank_MultiDimNotSupported);
-            if (items != null && keys.GetLowerBound(0) != items.GetLowerBound(0))
+            int keysLowerBound = keys.GetLowerBound(0);
+            if (items != null && keysLowerBound != items.GetLowerBound(0))
                 throw new ArgumentException(SR.Arg_LowerBoundsMustMatch);
-            if (index < keys.GetLowerBound(0) || length < 0)
+            if (index < keysLowerBound || length < 0)
                 throw new ArgumentOutOfRangeException((length < 0 ? "length" : "index"), SR.ArgumentOutOfRange_NeedNonNegNum);
-            if (keys.Length - (index - keys.GetLowerBound(0)) < length || (items != null && (index - items.GetLowerBound(0)) > items.Length - length))
+            if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length))
                 throw new ArgumentException(SR.Argument_InvalidOffLen);

             if (length > 1)


Add test coverage for generic method definition handle roundtripping (#17754)

Also, existing tests were not actually testing anything because they
missed `[Fact]` and the `RuntimeTypeHandleTest` would have succeeded no
matter what `r1` is. Fixed that.

--- src/System.Runtime/tests/System/HandleTests.cs
+++ src/System.Runtime/tests/System/HandleTests.cs
@@ -10,6 +10,7 @@

 public static class HandleTests
 {
+    [Fact]
     public static void  RuntimeFieldHandleTest()
     {
         Type t = typeof(Derived);
@@ -18,6 +19,7 @@
         Assert.True(h.Value != null);
     }

+    [Fact]
     public static void  RuntimeMethodHandleTest()
     {
         MethodInfo minfo = typeof( Co6006LateBoundDelegate).GetMethod( "Method1" );
@@ -30,10 +32,21 @@
         Assert.True(Co6006LateBoundDelegate.iInvokeCount == 1);
     }

+    [Fact]
+    public static void  GenericMethodRuntimeMethodHandleTest()
+    {
+        // Make sure uninstantiated generic method has a valid handle
+        MethodInfo mi1 = typeof(Base).GetMethod("GenericMethod");
+        MethodInfo mi2 = (MethodInfo)MethodBase.GetMethodFromHandle(mi1.MethodHandle);
+        Assert.Equal(mi1, mi2);
+    }
+
+    [Fact]
     public static void  RuntimeTypeHandleTest()
     {
         RuntimeTypeHandle r1 = typeof(int).TypeHandle;
-        Assert.True(r1 != null);
+        RuntimeTypeHandle r2 = typeof(uint).TypeHandle;
+        Assert.NotEqual(r1, r2);
     }

     private class Base
@@ -47,6 +60,7 @@
         public int MyProperty1 { get; private set; }
         public int MyProperty2 { private get; set; }

+        public static void GenericMethod<T>() { }
     }

     private class Derived : Base


Add some more test coverage for the new string(char*) impl

--- src/System.Runtime/tests/System/StringTests.cs
+++ src/System.Runtime/tests/System/StringTests.cs
@@ -23,6 +23,8 @@
         [InlineData(new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', '\0', 'i', 'j' }, "abcdefgh")]
         [InlineData(new char[] { 'a', '\0' }, "a")]
         [InlineData(new char[] { '\0' }, "")]
+        [InlineData(new char[] { '?', '@', ' ', '\0' }, "?@ ")] // ? and @ don't have overlapping bits
+        [InlineData(new char[] { '\u8001', '\u8002', '\ufffd', '\u1234', '\ud800', '\udfff', '\0' }, "\u8001\u8002\ufffd\u1234\ud800\udfff")] // chars with high bits set
         public static unsafe void Ctor_CharPtr(char[] valueArray, string expected)
         {
             fixed (char* value = valueArray)


Implicitly add "/** @jsx React.DOM */" when using JSXBundle. Use the same ConcatenationToken as used in the ScriptBundle class.

--- src/System.Web.Optimization.React/JsxBundle.cs
+++ src/System.Web.Optimization.React/JsxBundle.cs
@@ -23,7 +23,24 @@
 		/// </param>
 		public JsxBundle(string virtualPath) : base(virtualPath, GetTransforms())
 		{
+            base.ConcatenationToken = ";" + Environment.NewLine;
 		}
+
+        /// <summary>
+        /// Applies the transformations.
+        /// </summary>
+        /// <returns>The bundle response.</returns>
+        public override BundleResponse ApplyTransforms(BundleContext context, string bundleContent, Collections.Generic.IEnumerable<BundleFile> bundleFiles)
+        {
+            const string pragma = "/** @jsx React.DOM */";
+
+            if (!bundleContent.TrimStart().StartsWith(pragma))
+            {
+                bundleContent = pragma + bundleContent;
+            }
+
+            return base.ApplyTransforms(context, bundleContent, bundleFiles);
+        }

 		/// <summary>
 		/// Gets the transformations that should be used by the bundle.


Fix timing bug in test.

Fix timing bug in test.

--- src/Tests/Testify.Tests/TaskAssertionsTests.cs
+++ src/Tests/Testify.Tests/TaskAssertionsTests.cs
@@ -94,7 +94,7 @@
             Assert(Task.FromResult(1)).Completes(1, "Some {0}.", "message");

         [Fact]
-        public void Completes_TimeoutInTime_ShouldNotThrow() => Assert(Task.Delay(100)).Completes(200);
+        public void Completes_TimeoutInTime_ShouldNotThrow() => Assert(Task.Delay(100)).Completes(2000);

         [Fact]
         public void Completes_TimeoutMessageInTime_ShouldNotThrow() =>


Fix some newline issues

Fix some newline issues

--- src/Umbraco.Core/Strings/Css/StylesheetRule.cs
+++ src/Umbraco.Core/Strings/Css/StylesheetRule.cs
@@ -30,7 +30,7 @@
                 // instead of using string interpolation (for increased performance)
                 foreach (var style in Styles.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                 {
-                    sb.Append("\t").Append(style).Append(";").Append(Environment.NewLine);
+                    sb.Append("\t").Append(style.StripNewLines().Trim()).Append(";").Append(Environment.NewLine);
                 }
             }
             sb.Append("}");


Found additional usages for (var web = new HttpClient()) and replaced with private static readonly HttpClient HttpClient = new HttpClient();

--- src/Umbraco.Web/Editors/DashboardController.cs
+++ src/Umbraco.Web/Editors/DashboardController.cs
@@ -92,8 +92,6 @@
                 //content is null, go get it
                 try
                 {
-                    //                    using (var web = new HttpClient())
-                    //                    {
                     //fetch remote css
                     content = await HttpClient.GetStringAsync(url);

@@ -102,7 +100,6 @@

                     //save server content for 30 mins
                     ApplicationContext.ApplicationCache.RuntimeCache.InsertCacheItem<string>(key, () => result, new TimeSpan(0, 30, 0));
-                    //                    }
                 }
                 catch (HttpRequestException ex)
                 {


uses nameof in attributes

uses nameof in attributes

--- src/Umbraco.Web/Templates/TemplateUtilities.cs
+++ src/Umbraco.Web/Templates/TemplateUtilities.cs
@@ -15,10 +15,10 @@
 namespace Umbraco.Web.Templates
 {

-    [Obsolete("This class is obsolete, all methods have been moved to other classes: HtmlLocalLinkParser, HtmlUrlParser and HtmlImageSourceParser")]
+    [Obsolete("This class is obsolete, all methods have been moved to other classes: " + nameof(HtmlLocalLinkParser) + ", " + nameof(HtmlUrlParser) + " and " + nameof(HtmlImageSourceParser))]
     public static class TemplateUtilities
     {
-        [Obsolete("Inject and use an instance of HtmlLocalLinkParser instead")]
+        [Obsolete("Inject and use an instance of " + nameof(HtmlLocalLinkParser) + " instead")]
         internal static string ParseInternalLinks(string text, bool preview, UmbracoContext umbracoContext)
         {
             using (umbracoContext.ForcedPreview(preview)) // force for url provider
@@ -29,27 +29,27 @@
             return text;
         }

-        [Obsolete("Inject and use an instance of HtmlLocalLinkParser instead")]
+        [Obsolete("Inject and use an instance of " + nameof(HtmlLocalLinkParser) + " instead")]
         public static string ParseInternalLinks(string text, UrlProvider urlProvider)
             => Current.Factory.GetInstance<HtmlLocalLinkParser>().EnsureInternalLinks(text);

-        [Obsolete("Inject and use an instance of HtmlUrlParser")]
+        [Obsolete("Inject and use an instance of " + nameof(HtmlUrlParser))]
         public static string ResolveUrlsFromTextString(string text)
             => Current.Factory.GetInstance<HtmlUrlParser>().EnsureUrls(text);

-        [Obsolete("Use StringExtensions.CleanForXss instead")]
+        [Obsolete("Use " + nameof(StringExtensions) + "." + nameof(StringExtensions.CleanForXss) + " instead")]
         public static string CleanForXss(string text, params char[] ignoreFromClean)
             => text.CleanForXss(ignoreFromClean);

-        [Obsolete("Use HtmlImageSourceParser.EnsureImageSources instead")]
+        [Obsolete("Use " + nameof(HtmlImageSourceParser) + "." + nameof(HtmlImageSourceParser.EnsureImageSources) + " instead")]
         public static string ResolveMediaFromTextString(string text)
             => Current.Factory.GetInstance<HtmlImageSourceParser>().EnsureImageSources(text);

-        [Obsolete("Use HtmlImageSourceParser.RemoveImageSources instead")]
+        [Obsolete("Use " + nameof(HtmlImageSourceParser) + "." + nameof(HtmlImageSourceParser.RemoveImageSources) + " instead")]
         internal static string RemoveMediaUrlsFromTextString(string text)
             => Current.Factory.GetInstance<HtmlImageSourceParser>().RemoveImageSources(text);

-        [Obsolete("Use HtmlImageSourceParser.FindAndPersistPastedTempImages instead")]
+        [Obsolete("Use " + nameof(HtmlImageSourceParser) + "." + nameof(HtmlImageSourceParser.FindAndPersistPastedTempImages) + " instead")]
         internal static string FindAndPersistPastedTempImages(string html, Guid mediaParentFolder, int userId, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, ILogger logger)
             => Current.Factory.GetInstance<HtmlImageSourceParser>().FindAndPersistPastedTempImages(html, mediaParentFolder, userId);
     }


Added TransactionScope in global HandleAsync method of Jitney base class

--- source/SimpleDomain/Bus/Jitney.cs
+++ source/SimpleDomain/Bus/Jitney.cs
@@ -20,6 +20,7 @@
 {
     using System.Linq;
     using System.Threading.Tasks;
+    using System.Transactions;

     using SimpleDomain.Common;

@@ -64,14 +65,26 @@
         /// Handles an incomming envelope
         /// </summary>
         /// <param name="envelope">The envelope</param>
-        protected Task HandleAsync(Envelope envelope)
+        protected async Task HandleAsync(Envelope envelope)
         {
-            var incommingPipeline = this.Configuration.CreateIncommingPipeline(
-                this.HandleCommandAsync,
-                this.HandleEventAsync,
-                this.HandleSubscriptionMessageAsync);
+            using (var transactionScope = CreateTransactionScope())
+            {
+                var incommingPipeline = this.Configuration.CreateIncommingPipeline(
+                    this.HandleCommandAsync,
+                    this.HandleEventAsync,
+                    this.HandleSubscriptionMessageAsync);

-            return incommingPipeline.InvokeAsync(envelope);
+                await incommingPipeline.InvokeAsync(envelope).ConfigureAwait(false);
+
+                transactionScope.Complete();
+            }
+        }
+
+        private static TransactionScope CreateTransactionScope()
+        {
+            return new TransactionScope(
+                TransactionScopeOption.Required,
+                TransactionScopeAsyncFlowOption.Enabled);
         }

         private async Task HandleCommandAsync(ICommand command)


Disabled account confirmation check for beta period.

--- web/App_Code/LcAuthHelper.cs
+++ web/App_Code/LcAuthHelper.cs
@@ -82,11 +82,17 @@
         }
     }

-    public static LoginResult Login(string username, string password, bool rememberMe = false, bool returnProfile = false, bool allowUnconfirmed = false) {
-
+    public static LoginResult Login(string username, string password, bool rememberMe = false, bool returnProfile = false, bool allowUnconfirmed = false)
+    {
+        // AVOID FRUSTRATION IN BETA PERIOD REMOVING THE LOCK CHECK
+        // TODO: RE-ENABLE AFTER BETA
         checkAccountIsLocked(username);
-        if (!allowUnconfirmed)
-            checkAccountIsConfirmed(username);
+
+        // DISABLED CONFIRMATION CHECK FOR BETA PERIOD, BECAUSE WE HAVE NOT THE EMAIL CONFIRMATION READY
+        // AFTER THE WHOLE SITE AND MESSAGING CHANGE.
+        // TODO: RE-ENABLE AFTER BETA
+        //if (!allowUnconfirmed)
+        //    checkAccountIsConfirmed(username);

         if (LcAuth.Login(username, password, rememberMe)) {


naive trace implementation

naive trace implementation

--- mqpi/Controllers/MockedController.cs
+++ mqpi/Controllers/MockedController.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using Microsoft.AspNetCore.Http.Extensions;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
 using Microsoft.Rest;
@@ -18,6 +19,7 @@
         [HttpGet]
         public IEnumerable<dynamic> Get(string type)
         {
+            log.Info($"GET {type}");
             return new dynamic[]{};
         }

@@ -25,6 +27,7 @@
         [HttpGet("{id}")]
         public ActionResult Get(string type, int id)
         {
+            log.Info($"GET {type} id = {id}");
             return new NotFoundObjectResult($"{type} with id='{id}' was not found");
         }

@@ -32,7 +35,7 @@
         [HttpPost]
         public object Post(string type, [FromBody]dynamic value)
         {
-            log.Info($"POST {JsonConvert.SerializeObject(value, Formatting.Indented)}");
+            TraceNaively(value);
             var random = new Random(DateTime.UtcNow.Second);
             value.Id = random.Next();

@@ -43,6 +46,7 @@
         [HttpPut("{id}")]
         public dynamic Put(string type, [FromBody]dynamic value, int id)
         {
+            TraceNaively(value);
             if (value.id != id)
             {
                 return new BadRequestObjectResult("Id in the object must match id in URI");
@@ -55,7 +59,17 @@
         [HttpDelete("{id}")]
         public ActionResult Delete(string type, int id)
         {
+            TraceNaively();
             return Ok($"{type} {id} has been removed");
+        }
+
+        // todo: replace with tracing in handler i.antsipau
+        private void TraceNaively(dynamic value = null)
+        {
+            var request = ControllerContext.HttpContext.Request;
+
+            var body = value != null ? JsonConvert.SerializeObject(value, Formatting.Indented) : "";
+            log.Info($"{request.Method} {request.GetDisplayUrl()} {body}");
         }
     }
 }


post and put dummy impl

post and put dummy impl

--- mqpi/Controllers/ValuesController.cs
+++ mqpi/Controllers/ValuesController.cs
@@ -3,36 +3,48 @@
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.Rest;

 namespace mqpi.Controllers
 {
-    [Route("api/[controller]")]
+    [Route("api/{type}")]
     public class ValuesController : Controller
     {
         // GET api/values
         [HttpGet]
-        public IEnumerable<string> Get()
+        public IEnumerable<string> Get(string type)
         {
-            return new string[] { "value1", "value2" };
+            return new string[]{"smth", "smth2"};
         }

         // GET api/values/5
         [HttpGet("{id}")]
-        public string Get(int id)
+        public string Get(string type, int id)
         {
-            return "value";
+            return "type";
         }

         // POST api/values
         [HttpPost]
-        public void Post([FromBody]string value)
+        public object Post(string type, [FromBody]dynamic value)
         {
+            var random = new Random(DateTime.UtcNow.Second);
+            value.Id = random.Next();
+
+            return value;
         }

         // PUT api/values/5
         [HttpPut("{id}")]
-        public void Put(int id, [FromBody]string value)
+        public dynamic Put(string type, [FromBody]dynamic value, int id)
         {
+            if (value.id != id)
+            {
+                return new BadRequestObjectResult("Id in the object must match id in URI");
+            }
+
+            return value;
         }

         // DELETE api/values/5


Committing CAPS fix from Ahzz to prevent a stack overflow from 404 errors

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1125 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/Caps.cs
+++ libsecondlife/Caps.cs
@@ -161,6 +161,7 @@
                 if (e.Message.Contains("404"))
                 {
                     // This capability no longer exists, disable it
+                    Client.Log("Disabling CAPS due to 404", Helpers.LogLevel.Error);
                     Disconnect(true);
                     return;
                 }
@@ -173,7 +174,6 @@
                 {
                     Client.Log("CAPS initialization error for " + Simulator.ToString() + ": " + e.Message +
                         ", retrying", Helpers.LogLevel.Warning);
-                    // FIXME: No
                     goto MakeRequest;
                 }
             }
@@ -204,7 +204,17 @@
             {
                 Client.Log("CAPS error initializing the connection, retrying. " + e.Message,
                     Helpers.LogLevel.Warning);
-                Run();
+                if (e.Message.Contains("404"))
+                {
+                    // This capability no longer exists, disable it
+                    Client.Log("Disabling CAPS due to 404", Helpers.LogLevel.Error);
+                    Disconnect(true);
+                }
+                else
+                {
+                    Run();
+                }
+
                 return;
             }

@@ -244,10 +254,9 @@
             }
             catch (WebException e)
             {
-                if (e.Message.IndexOf("404") > 0)
+                if (e.Message.Contains("404"))
                 {
                     Client.DebugLog("Got a 404 from the CAPS system, disabling");
-                    // This capability no longer exists, disable it
                     Disconnect(true);
                 }
                 else if (e.Message.IndexOf("502") < 0)


[Modify] 2022

[Modify] 2022

--- websocket-sharp/Server/IWebSocketSession.cs
+++ websocket-sharp/Server/IWebSocketSession.cs
@@ -4,7 +4,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2013-2018 sta.blockhead
+ * Copyright (c) 2013-2022 sta.blockhead
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketBehavior.cs
+++ websocket-sharp/Server/WebSocketBehavior.cs
@@ -1102,7 +1102,7 @@
     protected void Send (Stream stream, int length)
     {
       if (_websocket == null) {
-        var msg = "The current state of the connection is not Open.";
+        var msg = "The session has not started yet.";

         throw new InvalidOperationException (msg);
       }


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Server/WebSocketBehavior.cs
+++ websocket-sharp/Server/WebSocketBehavior.cs
@@ -865,7 +865,7 @@
     }

     /// <summary>
-    /// Called when the WebSocket instance for a session gets an error.
+    /// Called when the WebSocket interface for a session gets an error.
     /// </summary>
     /// <param name="e">
     /// A <see cref="ErrorEventArgs"/> that represents the event data passed


Remove arming delay from assault rifle projectile.

--- ethernet/server/scripts/weapons/assaultrifle/assaultrifle.cs
+++ ethernet/server/scripts/weapons/assaultrifle/assaultrifle.cs
@@ -1,213 +1,213 @@
-//------------------------------------------------------------------------------
-// Revenge Of The Cats: Ethernet
-// Copyright (C) 2009, mEthLab Interactive
-//------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------
-// Revenge Of The Cats - assaultrifle.cs
-// Code for the assault rifle
-//------------------------------------------------------------------------------
-
-exec("./assaultrifle.sfx.cs");
-exec("./assaultrifle.gfx.cs");
-
-//-----------------------------------------------------------------------------
-
-datablock ShapeBaseImageData(HolsteredAssaultRifleImage)
-{
-	// basic item properties
-	shapeFile = "~/data/weapons/assaultrifle/image_holstered.dts";
-	emap = true;
-
-	// mount point & mount offset...
-	mountPoint  = 2;
-	offset = "0 0 0";
-
-	stateName[0] = "DoNothing";
-};
-
-//-----------------------------------------------------------------------------
-// projectile datablock...
-
-datablock TracerProjectileData(RedAssaultRifleProjectile)
-{
-	// script damage properties...
-	impactDamage       = 0;
-	impactImpulse      = 0;
-	splashDamage       = 25;
-	splashDamageRadius = 3;
-	splashImpulse      = 0;
-
-	// how much energy does firing this projectile drain?...
-	energyDrain = 10;
-
-	trackingAgility = 0;
-
-	explodesNearEnemies			= true;
-	explodesNearEnemiesRadius	= 3;
-	explodesNearEnemiesMask	  = $TypeMasks::PlayerObjectType;
-
-	//sound = AssaultRifleProjectileFlybySound;
-
-    projectileShapeName = "~/data/weapons/assaultrifle/projectile.dts";
-
-	explosion             = AssaultRifleProjectileImpact;
-	bounceExplosion		  = AssaultRifleProjectileBounceExplosion;
-	hitEnemyExplosion     = AssaultRifleProjectileImpact;
-	nearEnemyExplosion    = AssaultRifleProjectileExplosion;
-//	hitTeammateExplosion  = AssaultRifleProjectileImpact;
-//	hitDeflectorExplosion = DiscDeflectedEffect;
-
-//   particleEmitter	= AssaultRifleProjectileParticleEmitter;
-	laserTrail[0]   = AssaultRifleProjectileLaserTrail;
-//	laserTrail[1]   = AssaultRifleProjectileRedLaserTrail;
-	laserTail	    = AssaultRifleProjectileLaserTail;
-	laserTailLen    = 2;
-
-	muzzleVelocity		= 600;
-	velInheritFactor	 = 1.0;
-
-	isBallistic			= true;
-	gravityMod			 = 7.5;
-
-	armingDelay			= 75;
-	lifetime				= 1000*10;
-	fadeDelay			  = 5000;
-
-	decals[0]	= ExplosionDecalTwo;
-
-	hasLight	 = true;
-	lightRadius = 8.0;
-	lightColor  = "1.0 0.8 0.2";
-};
-
-function RedAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist)
-{
-    Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist);
-
-	if( !(%col.getType() & $TypeMasks::ShapeBaseObjectType) )
-		return;
-
-    %src =  %obj.getSourceObject();
-    if(%src)
-        %src.setDiscTarget(%col);
-}
-
-//--------------------------------------------------------------------------
-
-datablock TracerProjectileData(BlueAssaultRifleProjectile : RedAssaultRifleProjectile)
-{
-    dummyFieldToAvoidSyntaxError = 0;
-//	laserTrail[1] = AssaultRifleProjectileBlueLaserTrail;
-};
-
-function BlueAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist)
-{
-    RedAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist);
-}
-
-//--------------------------------------------------------------------------
-// weapon image which does all the work...
-// (images do not normally exist in the world, they can only
-// be mounted on ShapeBase objects)
-
-datablock ShapeBaseImageData(RedAssaultRifleImage)
-{
-	// add the WeaponImage namespace as a parent
-	className = WeaponImage;
-
-	// basic item properties
-	shapeFile = "~/data/weapons/assaultrifle/image.dts";
-	emap = true;
-
-	// mount point & mount offset...
-	mountPoint  = 0;
-	offset		= "0 0 0";
-	rotation	 = "0 0 0";
-	eyeOffset	= "0.325 0.4 -0.35";
-	eyeRotation = "0 0 0 0";
-
-	// Adjust firing vector to eye's LOS point?
-	correctMuzzleVector = true;
-
-	usesEnergy = true;
-	minEnergy = 15;
-
-	projectile = RedAssaultRifleProjectile;
-
-	// script fields...
-	iconId = 7;
-	mainWeapon = true;
-	armThread  = "holdrifle";  // armThread to use when holding this weapon
-	crosshair  = "assaultrifle"; // crosshair to display when holding this weapon
-
-	//-------------------------------------------------
-	// image states...
-	//
-		// preactivation...
-		stateName[0]                     = "Preactivate";
-		stateTransitionOnAmmo[0]         = "Activate";
-		stateTransitionOnNoAmmo[0]		 = "NoAmmo";
-
-		// when mounted...
-		stateName[1]                     = "Activate";
-		stateTransitionOnTimeout[1]      = "Ready";
-		stateTimeoutValue[1]             = 0.5;
-		stateSequence[1]                 = "Activate";
-
-		// ready to fire, just waiting for the trigger...
-		stateName[2]                     = "Ready";
-		stateTransitionOnNoAmmo[2]       = "NoAmmo";
-  		stateTransitionOnNotLoaded[2]    = "Disabled";
-		stateTransitionOnTriggerDown[2]  = "Fire";
-        stateArmThread[2]                = "holdrifle";
-
-		stateName[3]                     = "Fire";
-		stateTransitionOnTimeout[3]      = "KeepAiming";
-		stateTimeoutValue[3]             = 0.15;
-		stateFire[3]                     = true;
-		stateFireProjectile[3]           = RedAssaultRifleProjectile;
-		stateRecoil[3]                   = LightRecoil;
-		stateAllowImageChange[3]         = false;
-		stateEjectShell[3]               = true;
-		stateArmThread[3]                = "aimrifle";
-		stateSequence[3]                 = "Fire";
-		stateSound[3]                    = AssaultRifleFireSound;
-		stateScript[3]                   = "onFire";
-
-		stateName[4]                     = "KeepAiming";
-		stateTransitionOnNoAmmo[4]       = "NoAmmo";
-		stateTransitionOnNotLoaded[4]    = "Disabled";
-		stateTransitionOnTriggerDown[4]  = "Fire";
-		stateTransitionOnTimeout[4]      = "Ready";
-		stateWaitForTimeout[4]           = false;
-		stateTimeoutValue[4]             = 2.00;
-
-        // no ammo...
-		stateName[5]                     = "NoAmmo";
-		stateTransitionOnAmmo[5]         = "Ready";
-        stateTransitionOnTriggerDown[5]  = "DryFire";
-		stateSequence[5]                 = "NoAmmo";
-
-        // dry fire...
-		stateName[6]                     = "DryFire";
-		stateTransitionOnTriggerUp[6]    = "NoAmmo";
-		stateSound[6]                    = WeaponEmptySound;
-
-		// disabled...
-		stateName[7]                     = "Disabled";
-		stateTransitionOnLoaded[7]       = "Ready";
-		stateAllowImageChange[7]         = false;
-	//
-	// ...end of image states
-	//-------------------------------------------------
-};
-
-//------------------------------------------------------------------------------
-
-datablock ShapeBaseImageData(BlueAssaultRifleImage : RedAssaultRifleImage)
-{
-	projectile = BlueAssaultRifleProjectile;
-    stateFireProjectile[3] = BlueAssaultRifleProjectile;
-};
-
+//------------------------------------------------------------------------------
+// Revenge Of The Cats: Ethernet
+// Copyright (C) 2009, mEthLab Interactive
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Revenge Of The Cats - assaultrifle.cs
+// Code for the assault rifle
+//------------------------------------------------------------------------------
+
+exec("./assaultrifle.sfx.cs");
+exec("./assaultrifle.gfx.cs");
+
+//-----------------------------------------------------------------------------
+
+datablock ShapeBaseImageData(HolsteredAssaultRifleImage)
+{
+	// basic item properties
+	shapeFile = "~/data/weapons/assaultrifle/image_holstered.dts";
+	emap = true;
+
+	// mount point & mount offset...
+	mountPoint  = 2;
+	offset = "0 0 0";
+
+	stateName[0] = "DoNothing";
+};
+
+//-----------------------------------------------------------------------------
+// projectile datablock...
+
+datablock TracerProjectileData(RedAssaultRifleProjectile)
+{
+	// script damage properties...
+	impactDamage       = 0;
+	impactImpulse      = 0;
+	splashDamage       = 25;
+	splashDamageRadius = 3;
+	splashImpulse      = 0;
+
+	// how much energy does firing this projectile drain?...
+	energyDrain = 10;
+
+	trackingAgility = 0;
+
+	explodesNearEnemies			= true;
+	explodesNearEnemiesRadius	= 3;
+	explodesNearEnemiesMask	  = $TypeMasks::PlayerObjectType;
+
+	//sound = AssaultRifleProjectileFlybySound;
+
+    projectileShapeName = "~/data/weapons/assaultrifle/projectile.dts";
+
+	explosion             = AssaultRifleProjectileImpact;
+	bounceExplosion		  = AssaultRifleProjectileBounceExplosion;
+	hitEnemyExplosion     = AssaultRifleProjectileImpact;
+	nearEnemyExplosion    = AssaultRifleProjectileExplosion;
+//	hitTeammateExplosion  = AssaultRifleProjectileImpact;
+//	hitDeflectorExplosion = DiscDeflectedEffect;
+
+//   particleEmitter	= AssaultRifleProjectileParticleEmitter;
+	laserTrail[0]   = AssaultRifleProjectileLaserTrail;
+//	laserTrail[1]   = AssaultRifleProjectileRedLaserTrail;
+	laserTail	    = AssaultRifleProjectileLaserTail;
+	laserTailLen    = 2;
+
+	muzzleVelocity		= 600;
+	velInheritFactor	 = 1.0;
+
+	isBallistic			= true;
+	gravityMod			 = 7.5;
+
+	armingDelay			= 0;
+	lifetime				= 1000*10;
+	fadeDelay			  = 5000;
+
+	decals[0]	= ExplosionDecalTwo;
+
+	hasLight	 = true;
+	lightRadius = 8.0;
+	lightColor  = "1.0 0.8 0.2";
+};
+
+function RedAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist)
+{
+    Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist);
+
+	if( !(%col.getType() & $TypeMasks::ShapeBaseObjectType) )
+		return;
+
+    %src =  %obj.getSourceObject();
+    if(%src)
+        %src.setDiscTarget(%col);
+}
+
+//--------------------------------------------------------------------------
+
+datablock TracerProjectileData(BlueAssaultRifleProjectile : RedAssaultRifleProjectile)
+{
+    dummyFieldToAvoidSyntaxError = 0;
+//	laserTrail[1] = AssaultRifleProjectileBlueLaserTrail;
+};
+
+function BlueAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist)
+{
+    RedAssaultRifleProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal,%dist);
+}
+
+//--------------------------------------------------------------------------
+// weapon image which does all the work...
+// (images do not normally exist in the world, they can only
+// be mounted on ShapeBase objects)
+
+datablock ShapeBaseImageData(RedAssaultRifleImage)
+{
+	// add the WeaponImage namespace as a parent
+	className = WeaponImage;
+
+	// basic item properties
+	shapeFile = "~/data/weapons/assaultrifle/image.dts";
+	emap = true;
+
+	// mount point & mount offset...
+	mountPoint  = 0;
+	offset		= "0 0 0";
+	rotation	 = "0 0 0";
+	eyeOffset	= "0.325 0.4 -0.35";
+	eyeRotation = "0 0 0 0";
+
+	// Adjust firing vector to eye's LOS point?
+	correctMuzzleVector = true;
+
+	usesEnergy = true;
+	minEnergy = 15;
+
+	projectile = RedAssaultRifleProjectile;
+
+	// script fields...
+	iconId = 7;
+	mainWeapon = true;
+	armThread  = "holdrifle";  // armThread to use when holding this weapon
+	crosshair  = "assaultrifle"; // crosshair to display when holding this weapon
+
+	//-------------------------------------------------
+	// image states...
+	//
+		// preactivation...
+		stateName[0]                     = "Preactivate";
+		stateTransitionOnAmmo[0]         = "Activate";
+		stateTransitionOnNoAmmo[0]		 = "NoAmmo";
+
+		// when mounted...
+		stateName[1]                     = "Activate";
+		stateTransitionOnTimeout[1]      = "Ready";
+		stateTimeoutValue[1]             = 0.5;
+		stateSequence[1]                 = "Activate";
+
+		// ready to fire, just waiting for the trigger...
+		stateName[2]                     = "Ready";
+		stateTransitionOnNoAmmo[2]       = "NoAmmo";
+  		stateTransitionOnNotLoaded[2]    = "Disabled";
+		stateTransitionOnTriggerDown[2]  = "Fire";
+        stateArmThread[2]                = "holdrifle";
+
+		stateName[3]                     = "Fire";
+		stateTransitionOnTimeout[3]      = "KeepAiming";
+		stateTimeoutValue[3]             = 0.15;
+		stateFire[3]                     = true;
+		stateFireProjectile[3]           = RedAssaultRifleProjectile;
+		stateRecoil[3]                   = LightRecoil;
+		stateAllowImageChange[3]         = false;
+		stateEjectShell[3]               = true;
+		stateArmThread[3]                = "aimrifle";
+		stateSequence[3]                 = "Fire";
+		stateSound[3]                    = AssaultRifleFireSound;
+		stateScript[3]                   = "onFire";
+
+		stateName[4]                     = "KeepAiming";
+		stateTransitionOnNoAmmo[4]       = "NoAmmo";
+		stateTransitionOnNotLoaded[4]    = "Disabled";
+		stateTransitionOnTriggerDown[4]  = "Fire";
+		stateTransitionOnTimeout[4]      = "Ready";
+		stateWaitForTimeout[4]           = false;
+		stateTimeoutValue[4]             = 2.00;
+
+        // no ammo...
+		stateName[5]                     = "NoAmmo";
+		stateTransitionOnAmmo[5]         = "Ready";
+        stateTransitionOnTriggerDown[5]  = "DryFire";
+		stateSequence[5]                 = "NoAmmo";
+
+        // dry fire...
+		stateName[6]                     = "DryFire";
+		stateTransitionOnTriggerUp[6]    = "NoAmmo";
+		stateSound[6]                    = WeaponEmptySound;
+
+		// disabled...
+		stateName[7]                     = "Disabled";
+		stateTransitionOnLoaded[7]       = "Ready";
+		stateAllowImageChange[7]         = false;
+	//
+	// ...end of image states
+	//-------------------------------------------------
+};
+
+//------------------------------------------------------------------------------
+
+datablock ShapeBaseImageData(BlueAssaultRifleImage : RedAssaultRifleImage)
+{
+	projectile = BlueAssaultRifleProjectile;
+    stateFireProjectile[3] = BlueAssaultRifleProjectile;
+};
+


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Server/WebSocketBehavior.cs
+++ websocket-sharp/Server/WebSocketBehavior.cs
@@ -1233,8 +1233,7 @@
     }

     /// <summary>
-    /// Sends the specified data to a client asynchronously using
-    /// the WebSocket connection.
+    /// Sends the specified data to the client for a session asynchronously.
     /// </summary>
     /// <remarks>
     /// This method does not wait for the send to be complete.
@@ -1244,19 +1243,29 @@
     /// </param>
     /// <param name="completed">
     ///   <para>
-    ///   An <c>Action<bool></c> delegate or <see langword="null"/>
-    ///   if not needed.
+    ///   An <see cref="T:System.Action{bool}"/> delegate.
     ///   </para>
     ///   <para>
     ///   The delegate invokes the method called when the send is complete.
     ///   </para>
     ///   <para>
-    ///   <c>true</c> is passed to the method if the send has done with
-    ///   no error; otherwise, <c>false</c>.
-    ///   </para>
-    /// </param>
-    /// <exception cref="InvalidOperationException">
-    /// The current state of the connection is not Open.
+    ///   The <see cref="bool"/> parameter passed to the method is <c>true</c>
+    ///   if the send has successfully done; otherwise, <c>false</c>.
+    ///   </para>
+    ///   <para>
+    ///   <see langword="null"/> if not necessary.
+    ///   </para>
+    /// </param>
+    /// <exception cref="InvalidOperationException">
+    ///   <para>
+    ///   The session has not started yet.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
+    ///   The current state of the WebSocket interface is not Open.
+    ///   </para>
     /// </exception>
     /// <exception cref="ArgumentNullException">
     /// <paramref name="data"/> is <see langword="null"/>.


Add a summary to the Run method with its intent

--- src/nunit-gui/Program.cs
+++ src/nunit-gui/Program.cs
@@ -45,7 +45,13 @@
             Application.SetCompatibleTextRenderingDefault(false);
             Run(args);
         }
-
+
+        /// <summary>
+        /// The main entry point for the application, minus GUI initialization
+        /// logic. This method is intended for wrapper applications that
+        /// already do their own GUI initializations that would conflict with
+        /// those done in <see cref="Main"/>.
+        /// </summary>
         public static void Run(string[] args)
         {
             CommandLineOptions options = new CommandLineOptions();


EF db context: Ignore common unsupported array of primitive types

--- src/modules/Data.EF/AppDbContext.cs
+++ src/modules/Data.EF/AppDbContext.cs
@@ -7,7 +7,7 @@
 using System.Threading.Tasks;

 namespace core.Extensions.Data
-{
+{
     public class AppDbContext : DbContext
     {
         static AppDbContext()
@@ -19,6 +19,13 @@
         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
             base.OnModelCreating(modelBuilder);
+
+            //Ignore common unsupported array of primitive types
+            modelBuilder
+                .Ignore<int[]>()
+                .Ignore<long[]>()
+                .Ignore<Guid[]>()
+                .Ignore<string[]>();

             var tKeys = new KeyValuePair<Type, int>[] {
                 new KeyValuePair<Type,int>(typeof(IEntity<int>),11),


Removed virtual method annotation since it is not used

--- source/SimpleDomain.GiftcardSample/Domain/Giftcard.cs
+++ source/SimpleDomain.GiftcardSample/Domain/Giftcard.cs
@@ -38,8 +38,7 @@
             this.RegisterTransition<GiftcardLoaded>(this.Apply);
         }

-        public Giftcard(int cardNumber, decimal initialBalance, DateTime validUntil)
-            : this()
+        public Giftcard(int cardNumber, decimal initialBalance, DateTime validUntil) : this()
         {
             if (initialBalance < 0)
             {
@@ -54,7 +53,7 @@
             this.ApplyEvent(new GiftcardCreated(Guid.NewGuid(), cardNumber, initialBalance, validUntil));
         }

-        public virtual void Activate()
+        public void Activate()
         {
             if (this.isActivated)
             {
@@ -69,7 +68,7 @@
             this.ApplyEvent(new GiftcardActivated(this.Id));
         }

-        public virtual void Redeem(decimal amount)
+        public void Redeem(decimal amount)
         {
             if (!this.isActivated)
             {
@@ -89,7 +88,7 @@
             this.ApplyEvent(new GiftcardRedeemed(this.Id, amount));
         }

-        public virtual void Load(decimal amount)
+        public void Load(decimal amount)
         {
             if (!this.isActivated)
             {


fix decimal parsing for other locales

fix decimal parsing for other locales

--- src/Acr.UserDialogs.Android/Builders/PromptBuilder.cs
+++ src/Acr.UserDialogs.Android/Builders/PromptBuilder.cs
@@ -162,7 +162,7 @@
                 case InputType.DecimalNumber:
                     txt.InputType = InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned;
                     txt.SetSingleLine(true);
-                    txt.KeyListener = DigitsKeyListener.GetInstance(String.Format("1234567890{0}", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator));
+                    txt.KeyListener = DigitsKeyListener.GetInstance("1234567890" + CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
                     break;

                 case InputType.Email:
@@ -181,8 +181,8 @@
                     break;

                 case InputType.NumericPassword:
+                    txt.TransformationMethod = PasswordTransformationMethod.Instance;
                     txt.InputType = InputTypes.ClassNumber;
-                    txt.TransformationMethod = PasswordTransformationMethod.Instance;
                     break;

                 case InputType.Password:


Add vessel type Plane

Add vessel type Plane

--- kerbalgit/kerbalgit/GameObjects/Vessel.cs
+++ kerbalgit/kerbalgit/GameObjects/Vessel.cs
@@ -26,7 +26,8 @@
 			SpaceObject,
 			Rover,
 			Base,
-			Relay
+			Relay,
+			Plane
 		}

 		public enum DiscoveryLevel {


InvariantCulture for culture dependent tests

git-svn-id: c3b8989232654601f1acea7403f771adaaa44a81@221 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Tests/Lang/Compiler/CompilerErrorsTestCase.cs
+++ src/Boo.Tests/Lang/Compiler/CompilerErrorsTestCase.cs
@@ -31,6 +31,8 @@
 {
 	using System;
 	using System.IO;
+	using System.Globalization;
+	using System.Threading;
 	using NUnit.Framework;
 	using Boo.Lang.Compiler;
 	using Boo.Lang.Compiler.Pipeline;
@@ -52,6 +54,14 @@
 	[TestFixture]
 	public class CompilerErrorsTestCase : AbstractCompilerTestCase
 	{
+		[SetUp]
+		override public void SetUpTest()
+		{
+			base.SetUpTest();
+
+			Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
+		}
+
 		[Test]
 		public void ReadOnlyProperty()
 		{


Don't overwrite the refresh token if one is not given in the response

--- src/Couchbase.Lite.Shared/Auth/OpenIDAuthenticator.cs
+++ src/Couchbase.Lite.Shared/Auth/OpenIDAuthenticator.cs
@@ -152,6 +152,10 @@
                 return DeleteTokens();
             }

+            if (!tokens.ContainsKey ("refresh_token") && RefreshToken != null) {
+                tokens ["refresh_token"] = RefreshToken;
+            }
+
             var itemData = Manager.GetObjectMapper().WriteValueAsBytes(tokens);
             var request = CreateRequest();
             request.Data = itemData;
@@ -199,7 +203,11 @@
             }

             IDToken = idToken;
-            RefreshToken = tokens.GetCast<string>("refresh_token");
+            var newRefreshToken = tokens.GetCast<string>("refresh_token");
+            if (newRefreshToken != null) {
+                RefreshToken = newRefreshToken;
+            }
+
             Username = tokens.GetCast<string>("name");
             _haveSessionCookie = tokens.ContainsKey("session_id");
             return true;


style: adjust indent and change arg name

--- src/DlibDotNet/ImageProcessing/FrontalFaceDetector.cs
+++ src/DlibDotNet/ImageProcessing/FrontalFaceDetector.cs
@@ -92,23 +92,21 @@
             public static extern IntPtr get_frontal_face_detector();

             [DllImport(NativeMethods.NativeLibrary, CallingConvention = NativeMethods.CallingConvention)]
-            public static extern Dlib.Native.ErrorType frontal_face_detector_operator(
-                IntPtr detector,
-                Dlib.Native.Array2DType imgType,
-                IntPtr img,
-                double adjustThreshold,
-                IntPtr dets);
+            public static extern Dlib.Native.ErrorType frontal_face_detector_operator(IntPtr detector,
+                                                                                Dlib.Native.Array2DType imgType,
+                                                                                IntPtr img,
+                                                                                double adjustThreshold,
+                                                                                IntPtr dets);

             [DllImport(NativeMethods.NativeLibrary, CallingConvention = NativeMethods.CallingConvention)]
-            public static extern Dlib.Native.ErrorType frontal_face_detector_matrix_operator(
-                IntPtr detector,
-                Dlib.Native.MatrixElementType imgType,
-                IntPtr img,
-                double adjustThreshold,
-                IntPtr dets);
+            public static extern Dlib.Native.ErrorType frontal_face_detector_matrix_operator(IntPtr detector,
+                                                                                Dlib.Native.MatrixElementType imgType,
+                                                                                IntPtr img,
+                                                                                double adjustThreshold,
+                                                                                IntPtr dets);

             [DllImport(NativeMethods.NativeLibrary, CallingConvention = NativeMethods.CallingConvention)]
-            public static extern void frontal_face_detector_delete(IntPtr point);
+            public static extern void frontal_face_detector_delete(IntPtr detector);

         }


added sample app project description to about page

--- src/payroll/Views/Home/About.cshtml
+++ src/payroll/Views/Home/About.cshtml
@@ -6,6 +6,17 @@

@ViewData["Title"]

-
Sample asp.net 5 web application

+
XYZ Payroll is a sample asp.net 5 web application that calculates employee benefits payroll deductions
+        according to the following simple rules:

+

+
The cost of benefits is $1000/year for each employee

+
Each dependent, children and possibly a spouse, is additional deduction of $500/year

+
Anyone whose name startis with 'A' gets a 10% discount, employee or dependent

+

+
Other assumptions for simplicity:

+

+
All employees are paid $2000 per paycheck before deductions

+
There are 26 paychecks in a year

+


v1.1.3

--- console/Properties/AssemblyInfo.cs
+++ console/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("1.1.2.0")]
-[assembly: AssemblyFileVersion("1.1.2.0")]+[assembly: AssemblyVersion("1.1.3.0")]
+[assembly: AssemblyFileVersion("1.1.3.0")]


redundant region

redundant region

--- samples/ravendb/evolving-sagadata/Version_5/EndpointV3/Program.cs
+++ samples/ravendb/evolving-sagadata/Version_5/EndpointV3/Program.cs
@@ -8,8 +8,6 @@

     static void Main()
     {
-        #region Config
-
         BusConfiguration busConfiguration = new BusConfiguration();
         busConfiguration.EndpointName("Samples.RavenDB.Migration");
         DocumentStore documentStore = new DocumentStore
@@ -22,8 +20,6 @@
         busConfiguration.UsePersistence<RavenDBPersistence>()
             .DoNotSetupDatabasePermissions() //Only required to simplify the sample setup
             .SetDefaultDocumentStore(documentStore);
-
-        #endregion

         busConfiguration.UseSerialization<JsonSerializer>();
         busConfiguration.EnableInstallers();


Update TactSource

Update TactSource

--- samples/unity-plugin/Assets/bHapticsManager/Scripts/TactSource.cs
+++ samples/unity-plugin/Assets/bHapticsManager/Scripts/TactSource.cs
@@ -16,7 +16,7 @@

         [HideInInspector]
         [SerializeField]
-        public Pos Position = Pos.RightForearm;
+        public Pos Position = Pos.VestFront;

         // PathMode
         //[HideInInspector]
@@ -65,6 +65,7 @@

         private string currentFeedbackFileKey = "";
         private string currentFeedbackFileKeyReflect = "";
+

         void Awake()
         {
@@ -155,6 +156,18 @@

                     break;
             }
+        }
+
+        // For Windows, it will be working with bHaptics Player 1.5.6 onwards.
+        public void PlayWithStartMillis(int mediaMillis)
+        {
+            if (currentFeedbackFileKey != FeedbackFile.Id)
+            {
+                currentFeedbackFileKey = FeedbackFile.Id;
+                player.RegisterTactFileStr(currentFeedbackFileKey, FeedbackFile.Value);
+            }
+
+            player.SubmitRegistered(currentFeedbackFileKey, mediaMillis);
         }

         public void Stop()


Formats file length

Formats file length

--- src/FlubuCore/Infrastructure/Terminal/FlubuConsole.cs
+++ src/FlubuCore/Infrastructure/Terminal/FlubuConsole.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Reflection;
@@ -58,9 +59,10 @@
                     Console.WriteLine($"{directory.LastWriteTime}    <DIR>          {directory.Name}");
                 }

+                var nfi = new NumberFormatInfo { NumberGroupSeparator = "." };
                 foreach (var entry in allFiles)
                 {
-                    Console.WriteLine($"{entry.LastWriteTime}            {entry.Length} {entry.Name}");
+                    Console.WriteLine($"{entry.LastWriteTime}            {entry.Length.ToString("#,##0", nfi)} {entry.Name}");
                 }

                 Console.WriteLine(string.Empty);


Added the id of the parent to the error message

--- src/FluentWebUITesting/Controls/ControlWrapperBase.cs
+++ src/FluentWebUITesting/Controls/ControlWrapperBase.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using FluentWebUITesting.Accessors;
 using WatiN.Core;

@@ -40,32 +41,48 @@

         public IReadOnlyBooleanState Visible()
         {
-            const string unexpectedlyFalse = "{0} is not visible but should be.";
-            const string unexpectedlyTrue = "{0} is visible but should not be.";
+            const string unexpectedlyFalse = "{0} should be visible but is not because {1} is marked display: none .";
+            const string unexpectedlyTrue = "{0} should not be visible but is.";
+            var visibility = IsDisplayed(Element);
+            string parent;
+            if (visibility.Value != null)
+            {
+                parent = "its parent tag " + visibility.Value;
+            }
+            else
+            {
+                parent = "it";
+            }
             string unexpectedlyTrueMessage = String.Format(unexpectedlyTrue, HowFound);
-            string unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound);
+            string unexpectedlyFalseMessage = String.Format(unexpectedlyFalse, HowFound, parent);
+
             var result = new BooleanState(unexpectedlyFalseMessage,
                                           unexpectedlyTrueMessage,
-                                          () => IsDisplayed(Element));
+                                          () => visibility.Key);
             return result;
         }

-        // source http://blog.coditate.com/2009/07/determining-html-element-visibility.html
-        private static bool IsDisplayed(Element element)
+        // adapted from http://blog.coditate.com/2009/07/determining-html-element-visibility.html
+        private static KeyValuePair<bool, string> IsDisplayed(Element element)
         {
             if (string.Equals(element.Style.Display, "none"))
             {
-                return false;
+                return new KeyValuePair<bool, string>(false, element.TagName);
             }
-            if (string.Equals(element.TagName,"form",StringComparison.InvariantCultureIgnoreCase))
+            if (string.Equals(element.TagName, "form", StringComparison.InvariantCultureIgnoreCase))
             {
-                return true;
+                return new KeyValuePair<bool, string>(true, null);
             }
             if (element.Parent != null)
             {
-                return IsDisplayed(element.Parent);
+                var result = IsDisplayed(element.Parent);
+                if (result.Key)
+                {
+                    return result;
+                }
+                return new KeyValuePair<bool, string>(false, element.TagName + "." + result.Value);
             }
-            return true;
+            return new KeyValuePair<bool, string>(true, null);
         }
     }
 }


Need to actually validate that it is a github repo

--- src/GitHub.VisualStudio/Base/EnsureLoggedInSection.cs
+++ src/GitHub.VisualStudio/Base/EnsureLoggedInSection.cs
@@ -45,6 +45,10 @@
             if (ActiveRepo == null || ActiveRepoUri == null)
                 return;

+            var isgithub = await IsAGitHubRepo();
+            if (!isgithub)
+                return;
+
             vsServices.ClearNotifications();
             var add = HostAddress.Create(ActiveRepoUri);
             bool loggedIn = await connectionManager.IsLoggedIn(hosts, add);


Fix issue with ReadVirtualStream and PEHeader

Modules loaded with ReadVirtualStream sometimes did not correctly report
PDB information.  This is because the _virt flag was not set properly in
PEHeader.

--- src/Microsoft.Diagnostics.Runtime/Utilities/pefile.cs
+++ src/Microsoft.Diagnostics.Runtime/Utilities/pefile.cs
@@ -335,6 +335,8 @@

         private PEHeader(PEBuffer buffer, bool virt)
         {
+            _virt = virt;
+
             byte* ptr = buffer.Fetch(0, 0x300);
             _dosHeader = (IMAGE_DOS_HEADER*)ptr;
             _ntHeader = (IMAGE_NT_HEADERS*)((byte*)ptr + _dosHeader->e_lfanew);


fix anchor in include.

fix anchor in include.

--- src/Microsoft.DocAsCode.Dfm/DocfxFlavoredIncHelper.cs
+++ src/Microsoft.DocAsCode.Dfm/DocfxFlavoredIncHelper.cs
@@ -128,8 +128,10 @@
         private static void UpdateSingleHref(HtmlNode node, string attributeName, string filePath)
         {
             var href = node.GetAttributeValue(attributeName, string.Empty);
-            if (PathUtility.IsRelativePath(href))
+            if (PathUtility.IsRelativePath(href) && !href.StartsWith("#"))
+            {
                 node.SetAttributeValue(attributeName, RebaseHref(href, filePath, string.Empty));
+            }
         }

         private static string RebaseHref(string refPath, string source, string target)


Addressing PR comments

Addressing PR comments

--- src/Microsoft.Identity.Client/AppConfig/IAppConfig.cs
+++ src/Microsoft.Identity.Client/AppConfig/IAppConfig.cs
@@ -30,7 +30,7 @@
 namespace Microsoft.Identity.Client.AppConfig
 {
     /// <summary>
-    /// Sets of configuration parameters that were applied to build the application
+    /// Configuration properties used to build a public or confidential client application
     /// </summary>
     public interface IAppConfig
     {


Bugfix: References/Conversion with assignment

--- src/reni2/Type/AssignmentFeature.cs
+++ src/reni2/Type/AssignmentFeature.cs
@@ -33,8 +33,10 @@
 {
     sealed class AssignmentFeature : ReniObject, IFunctionFeature, ISuffixFeature
     {
+        static int _nextObjectId;
         readonly ISetterTargetType _target;
-        public AssignmentFeature(ISetterTargetType target) { _target = target; }
+
+        public AssignmentFeature(ISetterTargetType target):base(_nextObjectId++) { _target = target; }

         Result IFunctionFeature.ApplyResult(Category category, TypeBase argsType)
         {
@@ -44,7 +46,8 @@
             {
                 BreakExecution();
                 var sourceResult = argsType
-                    .Conversion(category, _target.ValueType.UniqueReference.Type());
+                    .Conversion(category.Typed, _target.ValueType)
+                    .SmartLocalReferenceResult();
                 Dump("sourceResult", sourceResult);
                 BreakExecution();


Add addresses

Add addresses

--- src/MiningCore/Blockchain/Bitcoin/BitcoinConstants.cs
+++ src/MiningCore/Blockchain/Bitcoin/BitcoinConstants.cs
@@ -80,6 +80,7 @@
         public static readonly Dictionary<CoinType, string> DevFeeAddresses = new Dictionary<CoinType, string>
         {
             {CoinType.BTC, "17QnVor1B6oK1rWnVVBrdX9gFzVkZZbhDm"},
+            {CoinType.BCH, "1LJGTzNDTuTvkHpTxNSdmAEBAXAnEHDVqQ"},
             {CoinType.LTC, "LTK6CWastkmBzGxgQhTTtCUjkjDA14kxzC"},
             {CoinType.DOGE, "DGDuKRhBewGP1kbUz4hszNd2p6dDzWYy9Q"},
             {CoinType.NMC, "NDSLDpFEcTbuRVcWHdJyiRZThVAcb5Z79o"},
@@ -93,7 +94,9 @@
             {CoinType.VTC, "VfCAvPVrksYvwcpU7E44e51HxfvVhcxMXf"},
             {CoinType.ZEC, "t1YHZHz2DGVMJiggD2P4fBQ2TAPgtLSUwZ7"},
             {CoinType.BTG, "GQb77ZuMCyJGZFyxpzqNfm7GB1rQreP4n6"},
-            {CoinType.XMR, "475YVJbPHPedudkhrcNp1wDcLMTGYusGPF5fqE7XjnragVLPdqbCHBdZg3dF4dN9hXMjjvGbykS6a77dTAQvGrpiQqHp2eH"}
+            {CoinType.MOON, "2QvpGimMYLyqKsczQXZjv56h6me3M8orwj" },
+            {CoinType.XMR, "475YVJbPHPedudkhrcNp1wDcLMTGYusGPF5fqE7XjnragVLPdqbCHBdZg3dF4dN9hXMjjvGbykS6a77dTAQvGrpiQqHp2eH"},
+            {CoinType.ETN, "etnkQJwBCjmR1MfkU8D355ZWxxLMhs8miPrtKHWN4U3uUowq9ugeKccVBoEG3n13n74us5AkT8tEoTog46w4HBgn8sMuBRhm9h"}
         };
     }


Bugfix: Removed infinate loop in the piece picker in cases where there are fast pieces we can request yet the peer doesn't actually have any of them.

svn path=/trunk/bitsharp/; revision=74332

--- src/MonoTorrent.Client/PiecePicking/StandardPicker.cs
+++ src/MonoTorrent.Client/PiecePicking/StandardPicker.cs
@@ -216,6 +216,10 @@
                         return this.GenerateRequest(id, requestIndex);
                     }
                 }
+
+                // If we get here it means that the peer had none of the fast pieces that we're allowed request
+                // so it means we can request no fast pieces off them
+                break;
             }

             return null;


[Modify] Rename it

[Modify] Rename it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -750,7 +750,7 @@
         return false;
       }

-      if (!validateSecWebSocketProtocolHeader (headers["Sec-WebSocket-Protocol"])) {
+      if (!validateSecWebSocketProtocolServerHeader (headers["Sec-WebSocket-Protocol"])) {
         message = "Includes no Sec-WebSocket-Protocol header, or it has an invalid value.";
         return false;
       }
@@ -1756,7 +1756,7 @@
     }

     // As client
-    private bool validateSecWebSocketProtocolHeader (string value)
+    private bool validateSecWebSocketProtocolServerHeader (string value)
     {
       if (value == null)
         return !_protocolsRequested;


Implement IDisposable

Implement IDisposable

svn path=/trunk/bitsharp/; revision=112988

--- src/MonoTorrent/MonoTorrent.Common/TimerDispatcher.cs
+++ src/MonoTorrent/MonoTorrent.Common/TimerDispatcher.cs
@@ -55,7 +55,8 @@
                 return String.Format ("{0} ({1})", Id, Trigger);
             }
         }
-
+
+        private bool disposed;
         private readonly object wait_mutex = new object ();
         private AutoResetEvent wait;

@@ -108,16 +109,22 @@
                 }
             }
         }
-
+        Thread t;
         private void Start ()
         {
             wait = new AutoResetEvent (false);
-            ThreadPool.QueueUserWorkItem (TimerThread);
+            t = new Thread(TimerThread);
+            t.Name = "Timer Dispatcher!";
+            t.IsBackground = true;
+            t.Start();
         }

         private void TimerThread (object state)
         {
             while (timeouts.Count > 0) {
+                if (disposed)
+                    return;
+
                 TimeoutItem item;
                 lock (timeouts) {
                     item = timeouts[0];
@@ -161,5 +168,14 @@
                 }
             }
         }
+
+        internal void Dispose()
+        {
+            if (disposed)
+                return;
+            disposed = true;
+            Enqueue(TimeSpan.Zero, delegate { return false; });
+            t.Join(TimeSpan.FromSeconds(2));
+        }
     }
 }


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -2715,11 +2715,20 @@
     }

     /// <summary>
-    /// Sends text <paramref name="data"/> using the WebSocket connection.
+    /// Sends the specified <paramref name="data"/> using the WebSocket connection.
     /// </summary>
     /// <param name="data">
     /// A <see cref="string"/> that represents the text data to send.
     /// </param>
+    /// <exception cref="InvalidOperationException">
+    /// The current state of the connection is not Open.
+    /// </exception>
+    /// <exception cref="ArgumentNullException">
+    /// <paramref name="data"/> is <see langword="null"/>.
+    /// </exception>
+    /// <exception cref="ArgumentException">
+    /// <paramref name="data"/> cannot be UTF8 encoded.
+    /// </exception>
     public void Send (string data)
     {
       if (_readyState != WebSocketState.Open) {


Fix race condition when test cases are run in parallel

--- src/NUnitFramework/tests/Internal/CallContextTests.cs
+++ src/NUnitFramework/tests/Internal/CallContextTests.cs
@@ -51,7 +51,7 @@
 //			CallContext.FreeNamedDataSlot(CONTEXT_DATA);
 //		}

-        [OneTimeTearDown]
+        [TearDown]
         public void FreeCallContextDataSlot()
         {
             // NOTE: We don't want possible side effects on other cross context tests.


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -1713,11 +1713,13 @@
       var buff = new StringBuilder (80);
       var comp = false;

-      foreach (var val in value.SplitHeaderValue (',')) {
-        var ext = val.Trim ();
+      foreach (var elm in value.SplitHeaderValue (',')) {
+        var extension = elm.Trim ();
+        if (extension.Length == 0)
+          continue;

         if (!comp) {
-          if (ext.IsCompressionExtension (CompressionMethod.Deflate)) {
+          if (extension.IsCompressionExtension (CompressionMethod.Deflate)) {
             _compression = CompressionMethod.Deflate;

             buff.AppendFormat (


added failing test for converting a string to int

--- src/Nancy.Tests/Unit/DynamicDictionaryValueFixture.cs
+++ src/Nancy.Tests/Unit/DynamicDictionaryValueFixture.cs
@@ -824,6 +824,20 @@
         }

         [Fact]
+        public void Should_return_default_when_given_string_that_is_not_a_number()
+        {
+            //Given
+            const int expected = 100;
+            dynamic value = new DynamicDictionaryValue("4abc2");
+
+            //When
+            int actual = value.TryParse<int>(expected);
+
+            //Then
+            Assert.Equal(expected, actual);
+        }
+
+        [Fact]
         public void Should_implicitly_convert_from_string_based_on_given_generic_type_of_decimal()
         {
             //Given


connect with a timeout to handle scneario where webscoket connection could not be established, so client can retry

--- websocket-sharp/WebSocket.cs
+++ websocket-sharp/WebSocket.cs
@@ -770,6 +770,58 @@
       return true;
     }

+    private bool beginConnect (long timeout) {
+        lock (_forConn) {
+            var msg = _readyState.CheckIfConnectable ();
+            if (msg != null) {
+                _logger.Error (msg);
+                error ("An error has occurred in connecting.", null);
+
+                return false;
+            }
+            try {
+                  _readyState = WebSocketState.Connecting;
+                    _tcpClient = new TcpClient();
+                    Uri uri ;
+                    if(_proxyUri != null) {
+                        uri = _proxyUri;
+                    } else {
+                        uri = _uri;
+                    }
+                    bool connectResult = true;
+                    IAsyncResult result = _tcpClient.BeginConnect(uri.DnsSafeHost, uri.Port, null, null);
+                    WaitHandle wh = result.AsyncWaitHandle;
+                    try
+                    {
+                        if (!result.AsyncWaitHandle.WaitOne(TimeSpan.FromMilliseconds((double)timeout), false))
+                        {
+                            error("Timed out connecting", null);
+                            connectResult = false;
+                            _tcpClient.Close();
+                        } else {
+                            _tcpClient.EndConnect(result);
+                        }
+                    }
+                    finally
+                    {
+                        wh.Close();
+                        Console.Write("Returning from connect");
+
+                    }
+                    if(connectResult) {
+                        if (_client ? doHandshake () : acceptHandshake ()) {
+                            _readyState = WebSocketState.Open;
+                            return true;
+                        }
+                    }
+                    return connectResult  ;
+            } catch (Exception ex) {
+                processException (ex, "An exception has occurred while connecting.");
+                return false;
+            }
+
+        }
+    }
     private bool connect ()
     {
       lock (_forConn) {
@@ -1376,14 +1428,18 @@
     // As client
     private void setClientStream ()
     {
-      if (_proxyUri != null) {
-        _tcpClient = new TcpClient (_proxyUri.DnsSafeHost, _proxyUri.Port);
-        _stream = _tcpClient.GetStream ();
-        sendProxyConnectRequest ();
-      }
-      else {
-        _tcpClient = new TcpClient (_uri.DnsSafeHost, _uri.Port);
-        _stream = _tcpClient.GetStream ();
+      if(_tcpClient == null || ! _tcpClient.Connected) {
+          if (_proxyUri != null) {
+            _tcpClient = new TcpClient (_proxyUri.DnsSafeHost, _proxyUri.Port);
+            _stream = _tcpClient.GetStream ();
+            sendProxyConnectRequest ();
+          }
+          else {
+            _tcpClient = new TcpClient (_uri.DnsSafeHost, _uri.Port);
+            _stream = _tcpClient.GetStream ();
+          }
+      } else {
+          _stream = _tcpClient.GetStream ();
       }

       if (_secure) {
@@ -1998,6 +2054,7 @@
     /// <remarks>
     /// This method doesn't wait for the connect to be complete.
     /// </remarks>
+
     public void ConnectAsync ()
     {
       var msg = checkIfCanConnect ();
@@ -2016,6 +2073,44 @@
         },
         null);
     }
+
+        public void Connect (long timeout)
+        {
+            var msg = checkIfCanConnect ();
+            if (msg != null) {
+                _logger.Error (msg);
+                error ("An error has occurred in connecting.", null);
+
+                return;
+            }
+
+            if(beginConnect(timeout)) {
+                open ();
+            }
+           /* Func<bool> connector = connect;
+            IAsyncResult result =  connector.BeginInvoke (
+                ar => {
+                if (connector.EndInvoke (ar))
+                    open ();
+            },
+            null);
+            WaitHandle wh = result.AsyncWaitHandle;
+            try
+            {
+                if (!result.AsyncWaitHandle.WaitOne(TimeSpan.FromMilliseconds((double)timeout), false))
+                {
+                    error("Timed out connecting", null);
+                }
+            }
+            finally
+            {
+                wh.Close();
+                Console.Write("Returning from connect");
+
+            }
+            return  ;*/
+        }
+

     /// <summary>
     /// Sends a Ping using the WebSocket connection.


Added SetCollectionAgeLimit(string grainTypeFullName, TimeSpan ageLimit) to use when Type is not available.

--- src/Orleans/Configuration/ApplicationConfiguration.cs
+++ src/Orleans/Configuration/ApplicationConfiguration.cs
@@ -143,13 +143,23 @@
         /// <param name="ageLimit">The age limit to use.</param>
         public void SetCollectionAgeLimit(Type type, TimeSpan ageLimit)
         {
+            SetCollectionAgeLimit(type.FullName, ageLimit);
+        }
+
+        /// <summary>
+        /// Sets the time period  to collect in-active activations for a given type.
+        /// </summary>
+        /// <param name="grainTypeFullName">Grain type full name string.</param>
+        /// <param name="ageLimit">The age limit to use.</param>
+        public void SetCollectionAgeLimit(string grainTypeFullName, TimeSpan ageLimit)
+        {
             ThrowIfLessThanZero(ageLimit, "ageLimit");

             GrainTypeConfiguration config;
-            if (!classSpecific.TryGetValue(type.FullName, out config))
-            {
-                config = new GrainTypeConfiguration(type.FullName);
-                classSpecific[type.FullName] = config;
+            if (!classSpecific.TryGetValue(grainTypeFullName, out config))
+            {
+                config = new GrainTypeConfiguration(grainTypeFullName);
+                classSpecific[grainTypeFullName] = config;
             }

             config.CollectionAgeLimit = ageLimit;
@@ -162,8 +172,18 @@
         /// <param name="ageLimit">The age limit to use.</param>
         public void ResetCollectionAgeLimitToDefault(Type type)
         {
+            ResetCollectionAgeLimitToDefault(type.FullName);
+        }
+
+        /// <summary>
+        /// Resets the time period to collect in-active activations for a given type to a default value.
+        /// </summary>
+        /// <param name="type">Grain type full name string.</param>
+        /// <param name="ageLimit">The age limit to use.</param>
+        public void ResetCollectionAgeLimitToDefault(string grainTypeFullName)
+        {
             GrainTypeConfiguration config;
-            if (!classSpecific.TryGetValue(type.FullName, out config)) return;
+            if (!classSpecific.TryGetValue(grainTypeFullName, out config)) return;

             config.CollectionAgeLimit = null;
         }


Fixed comment reference in CountBuilder Query method

--- src/PlainElastic.Net/Builders/Queries/CountBuilder.cs
+++ src/PlainElastic.Net/Builders/Queries/CountBuilder.cs
@@ -10,7 +10,7 @@
         /// The query element within the search request body allows to define a query using the Query DSL.
         /// QueryDsl does return content of expression without wrapping it into 'query' element. This is
         /// necessary for some commands e.g. Count.
-        /// see http://www.elasticsearch.org/guide/reference/api/search/query.html
+        /// see http://www.elasticsearch.org/guide/reference/query-dsl/
         /// </summary>
         public CountBuilder<T> Query(Func<QueryDsl<T>, Query<T>> query)
         {


added Originator field to commitment domain entity

--- src/SFA.DAS.Commitments.Domain/Entities/Commitment.cs
+++ src/SFA.DAS.Commitments.Domain/Entities/Commitment.cs
@@ -33,6 +33,7 @@
         public LastAction LastAction { get; set; }
         public bool EmployerCanApproveCommitment { get; set; }
         public bool ProviderCanApproveCommitment { get; set; }
+        public Originator Originator { get; set; }

         public string LastUpdatedByEmployerName { get; set; }
         public string LastUpdatedByEmployerEmail { get; set; }
@@ -45,6 +46,6 @@
         public List<Message> Messages { get; set; }
         [JsonIgnore]
         public bool HasTransferSenderAssigned => TransferSenderId > 0;
-
+
     }
 }


Remove unnecessary using directive

Remove unnecessary using directive

--- src/Abp/Reflection/ProxyHelper.cs
+++ src/Abp/Reflection/ProxyHelper.cs
@@ -1,5 +1,4 @@
-using Abp.Extensions;
-using Castle.DynamicProxy;
+using Castle.DynamicProxy;
 using System;

 namespace Abp.Reflection


Fix tests.

Fix tests.

--- source/MongoDB/Configuration/Mapping/Model/CollectionMemberMap.cs
+++ source/MongoDB/Configuration/Mapping/Model/CollectionMemberMap.cs
@@ -44,6 +44,10 @@
         public override object GetValue(object instance)
         {
             var elements = _collectionAdapter.GetElementsFromCollection(base.GetValue(instance));
+
+            if(elements == null)
+                return null;
+
             var list = new ArrayList();

             foreach (var element in elements)


chore: warning-- && better test

chore: warning-- && better test

--- source/Utils/PeanutButter.TrayIcon.Tests/TestMouseClickHandler.cs
+++ source/Utils/PeanutButter.TrayIcon.Tests/TestMouseClickHandler.cs
@@ -26,6 +26,8 @@
             Expect(sut.Clicks, Is.EqualTo(clicks));
             Expect(sut.Button, Is.EqualTo(button));
             Expect(sut.Action, Is.EqualTo(action));
+            sut.Action();
+            Expect(called, Is.True);
         }

     }


Match parameter names in a case-insensitive manner.

Fixes Microsoft/dotnet-apiport#38

--- src/ApiPort/CommandLine/CommandLineOptionSet.cs
+++ src/ApiPort/CommandLine/CommandLineOptionSet.cs
@@ -70,6 +70,29 @@
             }

             return this;
+        }
+
+        protected override bool Parse(string argument, OptionContext c)
+        {
+            string flag, name, sep, value;
+            if (GetOptionParts(argument, out flag, out name, out sep, out value))
+            {
+                name = GetCorrectOptionCasing(name);
+                return base.Parse(flag + name + sep + value, c);
+            }
+            return base.Parse(argument, c);
+        }
+
+        private string GetCorrectOptionCasing(string name)
+        {
+            foreach (string s in Dictionary.Keys)
+            {
+                if (s.Equals(name, StringComparison.OrdinalIgnoreCase))
+                {
+                    return s;
+                }
+            }
+            return name;
         }

         /// <summary>


register all types that derives from document

--- src/Takenet.MessagingHub.Client/Host/DomainManager.cs
+++ src/Takenet.MessagingHub.Client/Host/DomainManager.cs
@@ -63,7 +63,6 @@
                         var methodInfo = typeof(TypeUtil).GetMethod("RegisterDocument", BindingFlags.Public | BindingFlags.Static);
                         var generic = methodInfo.MakeGenericMethod(item);
                         generic.Invoke(null, null);
-                        Trace.TraceInformation("Register: " + item.Name + " " + item.Assembly.CodeBase);
                     }
                     catch (Exception ex) { }
                 }


Really minor thing, but more intuitive and less error-prone, being coherent with the naming convention of all other extension methods

--- src/Topshelf/Extensions/TopshelfSettingsExtensions.cs
+++ src/Topshelf/Extensions/TopshelfSettingsExtensions.cs
@@ -79,7 +79,7 @@
         /// <param name="settings">The process settings.</param>
         /// <param name="name">The friendly name of the service</param>
         /// <returns>The same <see cref="TopshelfSettings"/> instance so that multiple calls can be chained.</returns>
-        public static TopshelfSettings SetDisplayname(this TopshelfSettings settings, string name)
+        public static TopshelfSettings SetDisplayName(this TopshelfSettings settings, string name)
         {
             if (settings == null)
             {


Implemented token based validation

Implemented token based validation

--- AngleSharp/Css/ValueConverters/UnorderedOptionsConverter.cs
+++ AngleSharp/Css/ValueConverters/UnorderedOptionsConverter.cs
@@ -19,46 +19,23 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) && values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) && list.Count == 0;
         }
     }

@@ -77,49 +54,24 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) && _third.VaryAll(list, m => t3 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) && _third.VaryAll(list) && list.Count == 0;
         }
     }

@@ -140,52 +92,27 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3, T4>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-            //var t4 = default(T4);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    !_fourth.VaryAll(values, m => t4 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3, t4));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && _fourth.VaryAll(values) &&
-            //       values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+            var t4 = default(T4);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) &&
+                _third.VaryAll(list, m => t3 = m) && _fourth.VaryAll(list, m => t4 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3, t4));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) &&
+                _third.VaryAll(list) && _fourth.VaryAll(list) && list.Count == 0;
         }
     }

@@ -208,54 +135,30 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3, T4, T5>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-            //var t4 = default(T4);
-            //var t5 = default(T5);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    !_fourth.VaryAll(values, m => t4 = m) ||
-            //    !_fifth.VaryAll(values, m => t5 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3, t4, t5));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && _fourth.VaryAll(values) &&
-            //       _fifth.VaryAll(values) && values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+            var t4 = default(T4);
+            var t5 = default(T5);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) &&
+                _third.VaryAll(list, m => t3 = m) && _fourth.VaryAll(list, m => t4 = m) &&
+                _fifth.VaryAll(list, m => t5 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3, t4, t5));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) &&
+                _third.VaryAll(list) && _fourth.VaryAll(list) &&
+                _fifth.VaryAll(list) && list.Count == 0;
         }
     }

@@ -280,57 +183,32 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3, T4, T5, T6>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-            //var t4 = default(T4);
-            //var t5 = default(T5);
-            //var t6 = default(T6);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    !_fourth.VaryAll(values, m => t4 = m) ||
-            //    !_fifth.VaryAll(values, m => t5 = m) ||
-            //    !_sixth.VaryAll(values, m => t6 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3, t4, t5, t6));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && _fourth.VaryAll(values) &&
-            //       _fifth.VaryAll(values) && _sixth.VaryAll(values) &&
-            //       values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+            var t4 = default(T4);
+            var t5 = default(T5);
+            var t6 = default(T6);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) &&
+                _third.VaryAll(list, m => t3 = m) && _fourth.VaryAll(list, m => t4 = m) &&
+                _fifth.VaryAll(list, m => t5 = m) && _sixth.VaryAll(list, m => t6 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3, t4, t5, t6));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) &&
+                _third.VaryAll(list) && _fourth.VaryAll(list) &&
+                _fifth.VaryAll(list) && _sixth.VaryAll(list) &&
+                list.Count == 0;
         }
     }

@@ -357,59 +235,34 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3, T4, T5, T6, T7>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-            //var t4 = default(T4);
-            //var t5 = default(T5);
-            //var t6 = default(T6);
-            //var t7 = default(T7);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    !_fourth.VaryAll(values, m => t4 = m) ||
-            //    !_fifth.VaryAll(values, m => t5 = m) ||
-            //    !_sixth.VaryAll(values, m => t6 = m) ||
-            //    !_seventh.VaryAll(values, m => t7 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3, t4, t5, t6, t7));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && _fourth.VaryAll(values) &&
-            //       _fifth.VaryAll(values) && _sixth.VaryAll(values) &&
-            //       _seventh.VaryAll(values) && values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+            var t4 = default(T4);
+            var t5 = default(T5);
+            var t6 = default(T6);
+            var t7 = default(T7);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) &&
+                _third.VaryAll(list, m => t3 = m) && _fourth.VaryAll(list, m => t4 = m) &&
+                _fifth.VaryAll(list, m => t5 = m) && _sixth.VaryAll(list, m => t6 = m) &&
+                _seventh.VaryAll(list, m => t7 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3, t4, t5, t6, t7));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) &&
+                _third.VaryAll(list) && _fourth.VaryAll(list) &&
+                _fifth.VaryAll(list) && _sixth.VaryAll(list) &&
+                _seventh.VaryAll(list) && list.Count == 0;
         }
     }

@@ -438,62 +291,36 @@

         public Boolean TryConvert(IEnumerable<CssToken> value, Action<Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>>> setResult)
         {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //var t1 = default(T1);
-            //var t2 = default(T2);
-            //var t3 = default(T3);
-            //var t4 = default(T4);
-            //var t5 = default(T5);
-            //var t6 = default(T6);
-            //var t7 = default(T7);
-            //var t8 = default(T8);
-
-            //if (!_first.VaryAll(values, m => t1 = m) ||
-            //    !_second.VaryAll(values, m => t2 = m) ||
-            //    !_third.VaryAll(values, m => t3 = m) ||
-            //    !_fourth.VaryAll(values, m => t4 = m) ||
-            //    !_fifth.VaryAll(values, m => t5 = m) ||
-            //    !_sixth.VaryAll(values, m => t6 = m) ||
-            //    !_seventh.VaryAll(values, m => t7 = m) ||
-            //    !_eighth.VaryAll(values, m => t8 = m) ||
-            //    values.Length != 0)
-            //    return false;
-
-            //setResult(Tuple.Create(t1, t2, t3, t4, t5, t6, t7, t8));
-            return true;
-        }
-
-        public Boolean Validate(IEnumerable<CssToken> value)
-        {
-            //var values = value as CssValueList;
-
-            //if (values != null)
-            //    values = values.Copy();
-            //else if (value != null)
-            //    values = new CssValueList(value);
-            //else
-            //    values = new CssValueList();
-
-            //if (values.Length < MinArgs && values.Length > MaxArgs)
-            //    return false;
-
-            //return _first.VaryAll(values) && _second.VaryAll(values) &&
-            //       _third.VaryAll(values) && _fourth.VaryAll(values) &&
-            //       _fifth.VaryAll(values) && _sixth.VaryAll(values) &&
-            //       _seventh.VaryAll(values) && _eighth.VaryAll(values) &&
-            //       values.Length == 0;
-            return true;
+            var list = new List<CssToken>(value);
+            var t1 = default(T1);
+            var t2 = default(T2);
+            var t3 = default(T3);
+            var t4 = default(T4);
+            var t5 = default(T5);
+            var t6 = default(T6);
+            var t7 = default(T7);
+            var t8 = default(T8);
+
+            if (_first.VaryAll(list, m => t1 = m) && _second.VaryAll(list, m => t2 = m) &&
+                _third.VaryAll(list, m => t3 = m) && _fourth.VaryAll(list, m => t4 = m) &&
+                _fifth.VaryAll(list, m => t5 = m) && _sixth.VaryAll(list, m => t6 = m) &&
+                _seventh.VaryAll(list, m => t7 = m) && _eighth.VaryAll(list, m => t8 = m) && list.Count == 0)
+            {
+                setResult(Tuple.Create(t1, t2, t3, t4, t5, t6, t7, t8));
+                return true;
+            }
+
+            return false;
+        }
+
+        public Boolean Validate(IEnumerable<CssToken> value)
+        {
+            var list = new List<CssToken>(value);
+            return _first.VaryAll(list) && _second.VaryAll(list) &&
+                _third.VaryAll(list) && _fourth.VaryAll(list) &&
+                _fifth.VaryAll(list) && _sixth.VaryAll(list) &&
+                _seventh.VaryAll(list) && _eighth.VaryAll(list) &&
+                list.Count == 0;
         }
     }
 }


Create a standalone testreport directory for CLI {test} command

--- src/Arkivverket.Arkade.CLI/CommandLineRunner.cs
+++ src/Arkivverket.Arkade.CLI/CommandLineRunner.cs
@@ -281,6 +281,9 @@
             {
                 var standaloneTestReportsDirectory =
                     new DirectoryInfo(Path.Combine(outputDirectory, packageTestReportDirectory.Name));
+
+                standaloneTestReportsDirectory.Create();
+
                 Arkade.SaveReport(testSession, standaloneTestReportsDirectory);
                 Log.Information($"Test reports generated at: {standaloneTestReportsDirectory.FullName}");
             }


fixing tests

fixing tests

--- src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs
+++ src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs
@@ -31,6 +31,7 @@
 using Umbraco.Core.Persistence.Repositories;
 using Umbraco.Tests.LegacyXmlPublishedCache;
 using Umbraco.Tests.Testing.Objects.Accessors;
+using Umbraco.Web.Cache;

 namespace Umbraco.Tests.TestHelpers
 {
@@ -90,6 +91,8 @@
                 factory.ResetForTests();
                 return factory;
             });
+
+            Composition.RegisterUnique<BackgroundPublishedSnapshotNotifier>();
         }

         [OneTimeTearDown]


Update src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs

Co-Authored-By: Bjarke Berg <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@bergmania.dk>

--- src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
+++ src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
@@ -99,7 +99,7 @@
                     // Parse the HTML
                     var html = rte.Value?.ToString();

-                    var userId = _umbracoContextAccessor.UmbracoContext?.Security.CurrentUser.Id ?? -1;
+                    var userId = _umbracoContextAccessor.UmbracoContext?.Security.CurrentUser.Id ?? Constants.Security.SuperUserId;

                     var parsedHtml = TemplateUtilities.FindAndPersistPastedTempImages(html, mediaParentId, userId, _mediaService, _contentTypeBaseServiceProvider, _logger);
                     rte.Value = parsedHtml;


Make changes per review

Make changes per review

--HG--
branch : 1.1

--- src/VsExtension/FontAndColorsRegistrationAttribute.cs
+++ src/VsExtension/FontAndColorsRegistrationAttribute.cs
@@ -25,15 +25,15 @@
         }

         public override void Register(RegistrationContext context) {
-            var key = context.CreateKey(CategoryKey);
-
-            key.SetValue("Category", CategoryGuid);
-            key.SetValue("Package", PackageGuid);
-            key.SetValue("NameID", CategoryNameResourceID);
-            key.SetValue("ToolWindowPackage", ToolWindowPackageGuid);
+            using (var key = context.CreateKey(CategoryKey)) {
+                key.SetValue("Category", CategoryGuid);
+                key.SetValue("Package", PackageGuid);
+                key.SetValue("NameID", CategoryNameResourceID);
+                key.SetValue("ToolWindowPackage", ToolWindowPackageGuid);

             // IMPORTANT: without calling Close() the values won't be persisted to registry.
-            key.Close();
+                key.Close();
+            }
         }

         public override void Unregister(RegistrationContext context) {


Add Cli basic tests

Add Cli basic tests

--- src/Codetasy.Cli.Tests/CliTest.cs
+++ src/Codetasy.Cli.Tests/CliTest.cs
@@ -1,18 +1,65 @@
 using System;
 using Xunit;
 using Codetasy.Cli;
+using System.Collections.Generic;
+using System.IO;

 namespace Codetasy.Cli.Tests
 {
     public class CliTest
     {
         [Fact]
-        public void CanInstantiate()
+        public void CanExecuteCommand()
         {
-            var args = new string[0];
-            var cli = new Cli(args);
+            var executed = false;

-            Assert.IsType<Cli>(cli);
+            var arguments = new [] {"hello"};
+
+            var commands = new Dictionary<string, Action<CliDictionary<string, string>>>();
+            commands.Add("hello", args =>
+            {
+                executed = true;
+            });
+
+            new Cli(arguments).Execute(commands);
+
+            Assert.True(executed);
+        }
+
+        [Fact]
+        public void CanParseSingleArgument()
+        {
+            var message = string.Empty;
+
+            var arguments = new [] {"hello", "name=Frodo"};
+
+            var commands = new Dictionary<string, Action<CliDictionary<string, string>>>();
+            commands.Add("hello", args =>
+            {
+                message = $"Hello {args["name"]}";
+            });
+
+            new Cli(arguments).Execute(commands);
+
+            Assert.Equal("Hello Frodo", message);
+        }
+
+        [Fact]
+        public void CanParseMultipleArguments()
+        {
+            var message = string.Empty;
+
+            var arguments = new [] {"hello", "--name=\"Frodo Baggins\"", "--region=\"The Shire\""};
+
+            var commands = new Dictionary<string, Action<CliDictionary<string, string>>>();
+            commands.Add("hello", args =>
+            {
+                message = $"Hello {args["name"]} from {args["region"]}";
+            });
+
+            new Cli(arguments).Execute(commands);
+
+            Assert.Equal("Hello \"Frodo Baggins\" from \"The Shire\"", message);
         }
     }
 }