[csharp] fix build?

[csharp] fix build?

--- Gherkin.Specs/TestFileProvider.cs
+++ Gherkin.Specs/TestFileProvider.cs
@@ -11,7 +11,7 @@
     {
         public IEnumerable<string> GetValidTestFiles()
         {
-            string testFileFolder = Path.GetFullPath(Path.Combine(TestFolders.InputFolder, @"..\..\..\..\testdata"));
+            string testFileFolder = Path.GetFullPath(Path.Combine(TestFolders.InputFolder, "..", "..", "..", "..", @"testdata"));

             return Directory.GetFiles(testFileFolder, "*.feature");
         }


Missing ParseHTTP method for floats

Missing ParseHTTP method for floats

--- Hermod/HTTP/Server/JSONWrapper.cs
+++ Hermod/HTTP/Server/JSONWrapper.cs
@@ -1276,8 +1276,7 @@

-
-        public Boolean ParseHTTP(String ParameterName, HTTPRequest HTTPRequest, out Double Value, out HTTPResponse HTTPResp, String Context = null, Double DefaultValue = 0)
+        public Boolean ParseHTTP(String ParameterName, HTTPRequest HTTPRequest, out Single Value, out HTTPResponse HTTPResp, String Context = null, Single DefaultValue = 0)
         {

             Object JSONToken;
@@ -1294,7 +1293,7 @@

             if (JSONToken != null)
             {
-                if (!Double.TryParse(JSONToken.ToString(), NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out Value))
+                if (!Single.TryParse(JSONToken.ToString(), NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out Value))
                 {

                     Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
@@ -1319,7 +1318,7 @@

         }

-        public Boolean ParseHTTP(String ParameterName, HTTPRequest HTTPRequest, out DateTime Value, out HTTPResponse HTTPResp, String Context = null, DateTime DefaultValue = default(DateTime))
+        public Boolean ParseHTTP(String ParameterName, HTTPRequest HTTPRequest, out Double Value, out HTTPResponse HTTPResp, String Context = null, Double DefaultValue = 0)
         {

             Object JSONToken;
@@ -1336,11 +1335,7 @@

             if (JSONToken != null)
             {
-                try
-                {
-                    Value = (DateTime)JSONToken;
-                }
-                catch (Exception)
+                if (!Double.TryParse(JSONToken.ToString(), NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out Value))
                 {

                     Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
@@ -1355,6 +1350,52 @@

             else
             {
+                Value    = 0;
+                HTTPResp = null;
+                return false;
+            }
+
+            HTTPResp = null;
+            return true;
+
+        }
+
+        public Boolean ParseHTTP(String ParameterName, HTTPRequest HTTPRequest, out DateTime Value, out HTTPResponse HTTPResp, String Context = null, DateTime DefaultValue = default(DateTime))
+        {
+
+            Object JSONToken;
+
+            if (!TryGetValue(ParameterName, out JSONToken))
+            {
+
+                Value     = DefaultValue;
+                HTTPResp  = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName);
+
+                return false;
+
+            }
+
+            if (JSONToken != null)
+            {
+                try
+                {
+                    Value = (DateTime)JSONToken;
+                }
+                catch (Exception)
+                {
+
+                    Log.Timestamp("Bad request: Invalid \"" + ParameterName + "\" property value!");
+
+                    Value = DefaultValue;
+                    HTTPResp = HTTPExtentions.CreateBadRequest(HTTPRequest, Context, ParameterName, JSONToken.ToString());
+
+                    return false;
+
+                }
+            }
+
+            else
+            {
                 Value = DateTime.Now;
                 HTTPResp = null;
                 return false;


Refactor test to use separate type

Refactor test to use separate type

--- src/AppHarbor.Tests/TypeNameMatcherTest.cs
+++ src/AppHarbor.Tests/TypeNameMatcherTest.cs
@@ -13,7 +13,10 @@

 		class FooCommand : IFoo { }

+		class FooBarCommand : IFoo { }
+
 		private static Type FooCommandType = typeof(FooCommand);
+		private static Type FooBarCommandType = typeof(FooBarCommand);

 		[Fact]
 		public void ShouldThrowIfInitializedWithUnnasignableType()
@@ -34,7 +37,7 @@
 		[InlineData("Foo")]
 		public void ShouldThrowWhenMoreThanOneTypeMatches(string commandName)
 		{
-			var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType, FooCommandType });
+			var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType, FooBarCommandType });
 			Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName, null));
 		}


Output application name

Output application name

--- src/AppHarbor/Commands/DeployAppCommand.cs
+++ src/AppHarbor/Commands/DeployAppCommand.cs
@@ -101,7 +101,8 @@
 		{
 			var client = new RestClient("https://packageclient.apphb.com/");

-			_writer.Write("Write a deployment message: ");
+			_writer.WriteLine("The package will be deployed to application \"{0}\".", _applicationConfiguration.GetApplicationId());
+			_writer.Write("Enter a deployment message:");
 			var commitMessage = _reader.ReadLine();

 			var request = new RestRequest("applications/{slug}/buildnotifications", Method.POST)


Show package size with decimals

Show package size with decimals

--- src/AppHarbor/Commands/DeployAppCommand.cs
+++ src/AppHarbor/Commands/DeployAppCommand.cs
@@ -55,7 +55,7 @@
 						var buffer = new byte[4096];
 						memoryStream.Position = 0;

-						_writer.WriteLine("Uploading package (total size is {0} MB", memoryStream.Length / 1048576);
+						_writer.WriteLine("Uploading package (total size is {0} MB",  Math.Round((decimal)memoryStream.Length / 1048576, 2));

 						while (true)
 						{


Fix an annoying exception that gets swallowed later

See the comment about 9 lines above when looking at the diff!

--- src/BloomExe/CollectionTab/LibraryModel.cs
+++ src/BloomExe/CollectionTab/LibraryModel.cs
@@ -530,7 +530,7 @@
 				book.CheckBook(dialog.Progress, pathToFolderOfReplacementImages);
 				dialog.ProgressString.WriteMessage("");
 			}
-			dialog.ProgressBar.Value++;
+			dialog.Progress.ProgressIndicator.PercentCompleted = 100;
 		}


Remove ItemExpressionCapture.SeparatorLength

It's not consumed by anyone and increases size of the class.

--- src/Build/Evaluation/ExpressionShredder.cs
+++ src/Build/Evaluation/ExpressionShredder.cs
@@ -264,7 +264,7 @@
                     // Create an expression capture that encompases the entire expression between the @( and the )
                     // with the item name and any separator contained within it
                     // and each transform expression contained within it (i.e. each ->XYZ)
-                    ItemExpressionCapture expressionCapture = new ItemExpressionCapture(startPoint, endPoint - startPoint, expression.Substring(startPoint, endPoint - startPoint), itemName, separator, separatorStart, separatorLength, transformExpressions);
+                    ItemExpressionCapture expressionCapture = new ItemExpressionCapture(startPoint, endPoint - startPoint, expression.Substring(startPoint, endPoint - startPoint), itemName, separator, separatorStart, transformExpressions);
                     subExpressions.Add(expressionCapture);

                     continue;
@@ -738,11 +738,6 @@
             private int _separatorStart;

             /// <summary>
-            /// The length of the separator
-            /// </summary>
-            private int _separatorLength;
-
-            /// <summary>
             /// The function name, if any, within this expression
             /// </summary>
             private string _functionName;
@@ -756,7 +751,7 @@
             /// Create an Expression Capture instance
             /// Represents a sub expression, shredded from a larger expression
             /// </summary>
-            public ItemExpressionCapture(int index, int length, string subExpression) : this(index, length, subExpression, null, null, -1, -1, null)
+            public ItemExpressionCapture(int index, int length, string subExpression) : this(index, length, subExpression, null, null, -1, null)
             {
             }

@@ -764,7 +759,7 @@
             /// Create an Expression Capture instance
             /// Represents a sub expression, shredded from a larger expression
             /// </summary>
-            public ItemExpressionCapture(int index, int length, string subExpression, string itemType, string separator, int separatorStart, int separatorLength, List<ItemExpressionCapture> captures)
+            public ItemExpressionCapture(int index, int length, string subExpression, string itemType, string separator, int separatorStart, List<ItemExpressionCapture> captures)
             {
                 _index = index;
                 _length = length;
@@ -772,7 +767,6 @@
                 _itemType = itemType;
                 _separator = separator;
                 _separatorStart = separatorStart;
-                _separatorLength = separatorLength;
                 _captures = captures;
             }

@@ -837,14 +831,6 @@
             }

             /// <summary>
-            /// The length of the separator.
-            /// </summary>
-            public int SeparatorLength
-            {
-                get { return _separatorLength; }
-            }
-
-            /// <summary>
             /// The function name, if any, within this expression
             /// </summary>
             public string FunctionName


Apply suggestions from code review

Apply suggestions from code review

--- src/Components/Ignitor/src/BlazorClient.cs
+++ src/Components/Ignitor/src/BlazorClient.cs
@@ -56,7 +56,7 @@

         private CancellableOperation<CapturedAttachComponentCall> NextAttachComponentReceived { get; set; }

-        internal CancellableOperation<CapturedRenderBatch> NextBatchReceived { get; set; }
+        private CancellableOperation<CapturedRenderBatch> NextBatchReceived { get; set; }

         private CancellableOperation<string> NextErrorReceived { get; set; }

@@ -396,7 +396,7 @@
             NextJSInteropReceived?.Completion?.TrySetResult(null);
         }

-        protected virtual void OnRenderBatch(int id, byte[] data)
+        private void OnRenderBatch(int id, byte[] data)
         {
             var capturedBatch = new CapturedRenderBatch(id, data);


added CallerArgumentExpression test for MustBeShorterThan

--- Code/Light.GuardClauses.Tests/StringAssertions/MustBeShorterThanTests.cs
+++ Code/Light.GuardClauses.Tests/StringAssertions/MustBeShorterThanTests.cs
@@ -43,5 +43,16 @@
         [Fact]
         public static void CustomMessage() =>
             Test.CustomMessage<StringLengthException>(message => "Foo".MustBeShorterThan(1, message: message));
+
+        [Fact]
+        public static void CallerArgumentExpression()
+        {
+            const string message = "The messenger will be hanged later when the message is really long. But why do you want to hang him in the first place?";
+
+            var act = () => message.MustBeShorterThan(10);
+
+            act.Should().Throw<StringLengthException>()
+               .And.ParamName.Should().Be(nameof(message));
+        }
     }
 }


Tilemap Editor WiP #ADD: Added selection and mouse leave events.

--- DualityEditorPlugins/Tilemaps/CamViewStates/TilemapEditorCamViewState.cs
+++ DualityEditorPlugins/Tilemaps/CamViewStates/TilemapEditorCamViewState.cs
@@ -111,6 +111,21 @@
 				this.Invalidate();
 			}
 		}
+		protected override void OnMouseLeave(EventArgs e)
+		{
+			base.OnMouseLeave(e);
+			this.hoveredTile = InvalidTile;
+			this.hoveredRenderer = null;
+			this.Invalidate();
+		}
+		protected override void OnMouseDown(MouseEventArgs e)
+		{
+			base.OnMouseDown(e);
+			if (this.hoveredRenderer != null)
+			{
+				DualityEditorApp.Select(this, new ObjectSelection(this.hoveredRenderer.ActiveTilemap));
+			}
+		}

 		protected override void OnCollectStateDrawcalls(Canvas canvas)
 		{


Fix wrong motor index for vertical camer motor

--- DynamixelServo.Quadruped.WebInterface/VideoStreaming/CameraController.cs
+++ DynamixelServo.Quadruped.WebInterface/VideoStreaming/CameraController.cs
@@ -7,7 +7,7 @@
     {
         private readonly DynamixelDriver _driver;
         private const byte HorizontalMotorIndex = 13;
-        private const byte VerticalMotorIndex = 13;
+        private const byte VerticalMotorIndex = 14;

         public CameraController(DynamixelDriver driver)
         {


Update Password_Functions.cs

Update Password_Functions.cs

--- Test/AdventureWorksFunctionalModel/Person/Password_Functions.cs
+++ Test/AdventureWorksFunctionalModel/Person/Password_Functions.cs
@@ -9,6 +9,9 @@
 {
     public static class Password_Functions
     {
+        //TODO: Temporary function for testing only
+        public static (Person, IContext) CheckPassword(this Person p, [Password] string offered, IContext context) =>
+            (p, context.WithInformUser(p.Password.OfferedPasswordIsCorrect(offered) ? "CORRECT" : "INCORRECT"));

         #region ChangePassword
         public static (Person, IContext) ChangePassword(this Person p,
@@ -32,15 +35,18 @@
             string oldPassword, string newPassword, string confirm, IContext context)
         {
             var reason = "";
-            if (p.Password.OfferedPasswordIsCorrect(oldPassword))
-            {
-                reason += "Old Password is incorrect";
-            }
+            //TODO: Temp removed validation
+            //if (p.Password.OfferedPasswordIsCorrect(oldPassword))
+            //{
+            //    reason += "Old Password is incorrect";
+            //}
+
+            //if (newPassword == oldPassword)
+            //{
+            //    reason += "New Password should be different from Old Password";
+            //}
+
             reason += ValidateNewPassword(newPassword, confirm);
-            if (newPassword == oldPassword)
-            {
-                reason += "New Password should be different from Old Password";
-            }
             return reason;
         }


車両召喚時の車両名をGXTから取得するようにした

車両召喚時の車両名をGXTから取得するようにした

--- Inferno/InfernoScripts/World/Fulton.cs
+++ Inferno/InfernoScripts/World/Fulton.cs
@@ -272,7 +272,8 @@
         private void SpawnVehicle()
         {
             var hash = motherbaseVeh.Dequeue();
-            DrawText(hash.ToString(), 3.0f);
+            var vehicleGxtEntry = Function.Call<string>(Hash.GET_DISPLAY_NAME_FROM_VEHICLE_MODEL, (int)hash);
+            DrawText(Game.GetGXTEntry(vehicleGxtEntry), 3.0f);
             StartCoroutine(SpawnVehicleCoroutine(new Model(hash), PlayerPed.Position.AroundRandom2D(20)));
         }


Remove debug logging.

Remove debug logging.

--- Infusion.LegacyApi/Injection/Walker.cs
+++ Infusion.LegacyApi/Injection/Walker.cs
@@ -31,18 +31,15 @@
                 do
                 {
                     api.NotifyAction();
-                    api.Log("PressKey");
                     this.api.ClientWindow.PressKey((KeyCode)key);

                     journal.When<Events.PlayerMoveRequestedEvent>(request =>
                         {
                             moveRequestSent = true;
-                            api.Log("PlayerMoveRequestedEvent");
                         })
                         .WhenTimeout(() =>
                         {
                             moveRequestSent = false;
-                            api.Log("PlayerMoveRequestedEvent timeout");
                         })
                         .WaitAny(TimeSpan.FromSeconds(1));
                 } while (!moveRequestSent);
@@ -52,18 +49,15 @@
                 journal.When<Events.PlayerMoveRejectedEvent>(p =>
                     {
                         moveRequestFailed = true;
-                        api.Log("PlayerMoveRejectedEvent");
                     })
                     .When<Events.PlayerMoveAcceptedEvent>(p =>
                     {
                         moveRequestFailed = false;
-                        api.Log("PlayerMoveAcceptedEvent");
                     })
                     .WhenTimeout(() => {
                         if (attempts > maxAttempts)
                             throw new InjectionException("Cannot walk");
                         moveRequestFailed = true;
-                        api.Log("timeout");
                     })
                     .WaitAny(TimeSpan.FromSeconds(30));


Check if ApplicationId is null in GetRegistrations Fixes #346

--- PushSharp.Core/PushBroker.cs
+++ PushSharp.Core/PushBroker.cs
@@ -147,10 +147,10 @@
 			{
 				lock (serviceRegistrationsLock)
 				{
-					return from sr in serviceRegistrations
-					   where sr.ApplicationId.Equals (applicationId)
-						&& sr.NotificationType == type
-					   select sr.Service;
+                    return from sr in serviceRegistrations
+                           where (!string.IsNullOrEmpty (sr.ApplicationId) && sr.ApplicationId.Equals (applicationId))
+                               && sr.NotificationType == type
+                           select sr.Service;
 				}
 			}
 		}


Added a few more permission checks

Added a few more permission checks

--- src/Discord.Net.Commands/CommandService.cs
+++ src/Discord.Net.Commands/CommandService.cs
@@ -236,7 +236,10 @@
 			}

 			if (isFirst)
-				output.Append("There are no subcommands you have permission to run.");
+			{
+				output.Clear();
+				output.AppendLine("You do not have permission to access this command.");
+			}

 			return _client.SendMessage(replyChannel ?? channel, output.ToString());
 		}
@@ -248,6 +251,12 @@
 		}
 		private void ShowCommandHelpInternal(Command command, User user, Channel channel, StringBuilder output)
 		{
+			if (!command.CanRun(user, channel))
+			{
+				output.AppendLine("You do not have permission to access this command.");
+				return;
+			}
+
 			output.Append('`');
 			output.Append(command.Text);
 			foreach (var param in command.Parameters)


Changed ProjectManager property to method.

--- src/Editor/Editor.Server/ProjectManager.cs
+++ src/Editor/Editor.Server/ProjectManager.cs
@@ -152,10 +152,10 @@
         /// <summary>
         /// Read-only dictionary of all the projects.
         /// </summary>
-        public Task<Dictionary<Guid, Project>> Projects { get; private set; }
-        //{
-        //    get { return projects; }
-        //}
+        public async Task<Dictionary<Guid, Project>> GetProjects()
+        {
+            return projects;
+        }

         /// <summary>
         /// Event fired when a project is added.


Update Logging.cs

Update Logging.cs

Added better checks around log file not existing
Added FileNotFound and DirectoryNotFound exceptions

--- Infrastructure/Logging/Logging.cs
+++ Infrastructure/Logging/Logging.cs
@@ -70,7 +70,20 @@
         /// <param name="logConfigurationName">The configuration name of the logger, excluding the '.config' file extension</param>
         public Logging(string logDirectory, string logConfigurationName)
         {
-            this.logFile = new FileInfo(logDirectory + logConfigurationName + ".config");
+            // Check that the log directory exists
+            DirectoryInfo logParentDir = new DirectoryInfo(logDirectory);
+            if (!logParentDir.Exists)
+            {
+                throw new DirectoryNotFoundException("Specified directory does not exist for the configuration file! Directory Could Not Be Found: " + logParentDir.FullName);
+            }
+
+            // Check that the log file exists
+            this.logFile = new FileInfo(logParentDir.FullName + "\\" + logConfigurationName + ".config");
+            if (!this.logFile.Exists)
+            {
+                throw new FileNotFoundException("Specified configuration file cannot be found.", logFile.FullName);
+            }
+
             this.baseLogger = LogManager.GetLogger(typeof(Logging));
             this.logName = logConfigurationName;
             InitializeLogger();


CHANGED: Flow - Returning to main menu after victory, enabling mouse cursor again.

--- Unity/Rituals/Assets/Game/Scripts/Flow/Systems/VictorySystem.cs
+++ Unity/Rituals/Assets/Game/Scripts/Flow/Systems/VictorySystem.cs
@@ -61,7 +61,8 @@
             }

             // Victory!
-            Application.LoadLevel("GameScene");
+            Cursor.visible = true;
+            Application.LoadLevel("MainMenu");
         }

         private void OnObjectiveStateChanged(object sender, ObjectiveStateChangedEventArgs args)


Add test for variable coercion (#1919)

Add test for variable coercion (#1919)

* add test for variable coercion

* todo

--- src/GraphQL.Tests/Bugs/ScalarsInputTest.cs
+++ src/GraphQL.Tests/Bugs/ScalarsInputTest.cs
@@ -1,4 +1,5 @@
 using System;
+using GraphQL.SystemTextJson;
 using GraphQL.Types;
 using Shouldly;
 using Xunit;
@@ -162,6 +163,31 @@
 }";
             AssertQuery(query, expected, null, null);
         }
+
+        [Fact]
+        public void Should_Accept_Long_As_Long_In_Literal()
+        {
+            var query = @"mutation { long(number: 100) }";
+            var expected = @"{ ""long"": 100 }";
+            AssertQuerySuccess(query, expected, null, null);
+        }
+
+        [Fact]
+        public void Should_Not_Accept_String_As_Long_In_Literal()
+        {
+            var query = @"mutation { long(number: ""100"") }";
+            string expected = null;
+            AssertQueryWithErrors(query, expected, expectedErrorCount: 1);
+        }
+
+        // TODO: rework to throw exception
+        [Fact]
+        public void Should_Accept_String_As_Long_In_Variable()
+        {
+            var query = @"mutation AAA($val : Long!) { long(number: $val) }";
+            var expected = @"{ ""long"": 100 }";
+            AssertQuerySuccess(query, expected, @"{ ""val"": ""100"" }".ToInputs(), null);
+        }
     }

     public class SchemaForScalars : Schema
@@ -317,6 +343,16 @@
                     arg.decZero.ShouldBe(12.10m);
                     return arg;
                 });
+
+            Field<LongGraphType>(
+                "long",
+                arguments: new QueryArguments(new QueryArgument<LongGraphType> { Name = "number" }),
+                resolve: ctx =>
+                {
+                    var arg = ctx.GetArgument<long>("number");
+                    arg.ShouldBe(100L);
+                    return arg;
+                });
         }
     }
 }


Stop header on first line in plots

Stop header on first line in plots

--- Joinrpg/Helpers/MarkDownHelper.cs
+++ Joinrpg/Helpers/MarkDownHelper.cs
@@ -42,7 +42,7 @@
       {
         return null;
       }
-      var idx = markdownString.Contents.TakeWhile(c => (words -= (char.IsWhiteSpace(c) ? 1 : 0)) > 0).Count();
+      var idx = markdownString.Contents.TakeWhile(c => (words -= (char.IsWhiteSpace(c)? 1 : 0)) > 0 && c != '\n').Count();
       var mdContents = markdownString.Contents.Substring(0, idx);
       return new HtmlString(Convert(mdContents));
     }


Round off some edges with ItemDefinitions

--- Facepunch.Steamworks/SteamInventory.cs
+++ Facepunch.Steamworks/SteamInventory.cs
@@ -33,29 +33,25 @@
 		internal static void InstallEvents()
 		{
 			SteamInventoryFullUpdate_t.Install( x => OnInventoryUpdated?.Invoke( x.Handle ) );
-			SteamInventoryDefinitionUpdate_t.Install( x => DefinitionsUpdated() );
+			SteamInventoryDefinitionUpdate_t.Install( x => LoadDefinitions() );
 		}

 		public static event Action<int> OnInventoryUpdated;
 		public static event Action OnDefinitionsUpdated;

-		internal static int defUpdateCount = 0;
-
-		internal static void DefinitionsUpdated()
+		static void LoadDefinitions()
 		{
 			Definitions = GetDefinitions();

-			if ( Definitions != null )
-			{
-				_defMap = new Dictionary<int, InventoryDef>();
-
-				foreach ( var d in Definitions )
-				{
-					_defMap[d.Id] = d;
-				}
-			}
-
-			defUpdateCount++;
+			if ( Definitions == null )
+				return;
+
+			_defMap = new Dictionary<int, InventoryDef>();
+
+			foreach ( var d in Definitions )
+			{
+				_defMap[d.Id] = d;
+			}

 			OnDefinitionsUpdated?.Invoke();
 		}
@@ -68,15 +64,32 @@
 		/// </summary>
 		public static void LoadItemDefinitions()
 		{
+			// If they're null, try to load them immediately
+			// my hunch is that this loads a disk cached version
+			// but waiting for LoadItemDefinitions downloads a new copy
+			// from Steam's servers. So this will give us immediate data
+			// where as Steam's inventory servers could be slow/down
+			if ( Definitions == null )
+			{
+				LoadDefinitions();
+			}
+
 			Internal.LoadItemDefinitions();
 		}

 		/// <summary>
 		/// Will call LoadItemDefinitions and wait until Definitions is not null
 		/// </summary>
-		public static async Task<bool> WaitForDefinitions( float timeoutSeconds = 10 )
-		{
+		public static async Task<bool> WaitForDefinitions( float timeoutSeconds = 30 )
+		{
+			if ( Definitions != null )
+				return true;
+
+			LoadDefinitions();
 			LoadItemDefinitions();
+
+			if ( Definitions != null )
+				return true;

 			var sw = Stopwatch.StartNew();


Implemented Update() in TablaturePlaylistDocument.

--- FileTypes/TablaturePlaylistDocument.cs
+++ FileTypes/TablaturePlaylistDocument.cs
@@ -98,7 +98,8 @@

         public void Update()
         {
-            throw new NotImplementedException();
+            if (FileVersion != FILE_VERSION)
+                Save();
         }

         #endregion


although static RNG is needed then

although static RNG is needed then

--- JefBot/Commands/GalaxyPluginCommand.cs
+++ JefBot/Commands/GalaxyPluginCommand.cs
@@ -25,7 +25,7 @@
         public static HttpClient client = new HttpClient();

-        Random rng = new Random();
+        public static Random rng = new Random();
         //define the colour white
         System.Drawing.Color c = System.Drawing.Color.FromArgb(255, 255, 255);


Added the final case - should return FizzBuzz when the input is a multiple of three and five.

--- FizzBuzz.Tests/FizzBuzz.Tests/Tests.cs
+++ FizzBuzz.Tests/FizzBuzz.Tests/Tests.cs
@@ -14,6 +14,7 @@
         [InlineData(6, "Fizz")]
         [InlineData(9, "Fizz")]
         [InlineData(10, "Buzz")]
+        [InlineData(15, "FizzBuzz")]
         public void It_should_convert_it_to_expected_value(int input, string expected)
         {
             var sut = new Converter();


Test cases for timing

Test cases for timing

--- King.Service.Tests/TaskManagerTests.cs
+++ King.Service.Tests/TaskManagerTests.cs
@@ -72,6 +72,24 @@
             var m = new TestManager(100, 100);
             m.Start();
             m.TestDispose();
+        }
+
+        [Test]
+        public void StartIn()
+        {
+            var random = new Random();
+            var expected = random.Next();
+            var m = new TestManager(expected, 100);
+            Assert.AreEqual(expected, m.StartIn.TotalSeconds);
+        }
+
+        [Test]
+        public void Every()
+        {
+            var random = new Random();
+            var expected = random.Next();
+            var m = new TestManager(100, expected);
+            Assert.AreEqual(expected, m.Every.TotalSeconds);
         }

         [Test]


Create data folder even if test_data field is not used

--- Kudu.Core/Functions/FunctionManager.cs
+++ Kudu.Core/Functions/FunctionManager.cs
@@ -107,6 +107,7 @@

             string newConfig = null;
             string configPath = Path.Combine(functionDir, Constants.FunctionsConfigFile);
+            string dataFilePath = GetFunctionTestDataFilePath(name);

             // If files are included, write them out
             if (functionEnvelope?.Files != null)
@@ -145,7 +146,7 @@

             if (functionEnvelope.TestData != null)
             {
-                await FileSystemHelpers.WriteAllTextToFileAsync(GetFunctionTestDataFilePath(name), functionEnvelope.TestData);
+                await FileSystemHelpers.WriteAllTextToFileAsync(dataFilePath, functionEnvelope.TestData);
             }

             return await GetFunctionConfigAsync(name);
@@ -334,7 +335,6 @@
             // Create an empty file if it doesn't exist
             if (!FileSystemHelpers.FileExists(testDataFilePath))
             {
-                FileSystemHelpers.EnsureDirectory(Path.GetDirectoryName(testDataFilePath));
                 FileSystemHelpers.WriteAllText(testDataFilePath, String.Empty);
             }


Portals

Portals

--- wServer/logic/db/BehaviorDb.CandyLand.cs
+++ wServer/logic/db/BehaviorDb.CandyLand.cs
@@ -12,6 +12,22 @@
     partial class BehaviorDb
     {
         private _ CandyLand = () => Behav()
+        .Init("Candy Gnome",
+            new State(
+                new DropPortalOnDeath("Candyland Portal", percent: 50, PortalDespawnTimeSec: 120),
+                new Prioritize(
+                    new StayBack(1.5, 55),
+                    new Wander(1.4)
+                    )
+                ),
+            new Threshold(0.18,
+                new ItemLoot("Red Gumball", 0.5),
+                new ItemLoot("Purple Gumball", 0.5),
+                new ItemLoot("Blue Gumball", 0.5),
+                new ItemLoot("Green Gumball", 0.5),
+                new ItemLoot("Yellow Gumball", 0.5)
+                )
+            )
             .Init("Desire Troll",
                 new State(
                     new Wander(0.5),


#427 show actual type name

#427 show actual type name

--- NakedFramework/NakedFramework.Metamodel/Facet/TitleFacetViaActualType.cs
+++ NakedFramework/NakedFramework.Metamodel/Facet/TitleFacetViaActualType.cs
@@ -8,6 +8,7 @@
 using System;
 using NakedFramework.Architecture.Adapter;
 using NakedFramework.Architecture.Framework;
+using NakedFramework.Core.Util;

 namespace NakedFramework.Metamodel.Facet;

@@ -15,9 +16,9 @@
 public sealed class TitleFacetViaActualType : TitleFacetAbstract {
     private TitleFacetViaActualType() { }

-    public static TitleFacetViaActualType Instance { get; } = new TitleFacetViaActualType();
+    public static TitleFacetViaActualType Instance { get; } = new();

-    public override string GetTitle(INakedObjectAdapter nakedObjectAdapter, INakedFramework framework) => $"Unknown type: {nakedObjectAdapter?.Object?.GetType()}";
+    public override string GetTitle(INakedObjectAdapter nakedObjectAdapter, INakedFramework framework) => $"Unknown type: {FasterTypeUtils.GetProxiedType(nakedObjectAdapter?.Object?.GetType())}";
 }

 // Copyright (c) Naked Objects Group Ltd.


Added Event Receiver Extensions

Added Event Receiver Extensions

--- OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/SiteExtensions.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/SiteExtensions.cs
@@ -854,8 +854,8 @@
             web.Update();

             web.Context.ExecuteQuery();
-            if(checkIndexed)
-            RemoveIndexedPropertyBagKey(web, key); // Will only remove it if it exists as an indexed property
+            if (checkIndexed)
+                RemoveIndexedPropertyBagKey(web, key); // Will only remove it if it exists as an indexed property
         }
         /// <summary>
         /// Get int typed property bag value. If does not contain, returns default value.
@@ -1021,6 +1021,7 @@

         #endregion

+        #region Search
         /// <summary>
         /// Queues a web for a _full_ crawl the next incremental crawl
         /// </summary>
@@ -1034,6 +1035,106 @@
             }
             web.SetPropertyBagValue("vti_searchversion", searchversion + 1);
         }
+        #endregion
+
+        #region Events
+
+        /// <summary>
+        /// Registers a remote event receiver
+        /// </summary>
+        /// <param name="web">The web to process</param>
+        /// <param name="name">The name of the event receiver (needs to be unique among the event receivers registered on this list)</param>
+        /// <param name="url">The URL of the remote WCF service that handles the event</param>
+        /// <param name="eventReceiverType"></param>
+        /// <param name="synchronization"></param>
+        /// <param name="force">If True any event already registered with the same name will be removed first.</param>
+        /// <returns>Returns an EventReceiverDefinition if succeeded. Returns null if failed.</returns>
+        public static EventReceiverDefinition RegisterRemoteEventReceiver(this Web web, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, bool force)
+        {
+            var query = from receiver
+                   in web.EventReceivers
+                        where receiver.ReceiverName == name
+                        select receiver;
+            web.Context.LoadQuery(query);
+            web.Context.ExecuteQuery();
+
+            var receiverExists = query.Any();
+            if (receiverExists && force)
+            {
+                var receiver = query.FirstOrDefault();
+                receiver.DeleteObject();
+                web.Context.ExecuteQuery();
+                receiverExists = false;
+            }
+            EventReceiverDefinition def = null;
+
+            if (!receiverExists)
+            {
+                EventReceiverDefinitionCreationInformation receiver = new EventReceiverDefinitionCreationInformation();
+                receiver.EventType = eventReceiverType;
+                receiver.ReceiverUrl = url;
+                receiver.ReceiverName = name;
+                receiver.Synchronization = synchronization;
+                def = web.EventReceivers.Add(receiver);
+                web.Context.Load(def);
+                web.Context.ExecuteQuery();
+            }
+            return def;
+        }
+
+        /// <summary>
+        /// Returns an event receiver definition
+        /// </summary>
+        /// <param name="list"></param>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public static EventReceiverDefinition GetEventReceiverById(this Web web, Guid id)
+        {
+            IEnumerable<EventReceiverDefinition> receivers = null;
+            var query = from receiver
+                        in web.EventReceivers
+                        where receiver.ReceiverId == id
+                        select receiver;
+
+            receivers = web.Context.LoadQuery(query);
+            web.Context.ExecuteQuery();
+            if (receivers.Any())
+            {
+                return receivers.FirstOrDefault();
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Returns an event receiver definition
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public static EventReceiverDefinition GetEventReceiverByName(this Web web, string name)
+        {
+            IEnumerable<EventReceiverDefinition> receivers = null;
+            var query = from receiver
+                        in web.EventReceivers
+                        where receiver.ReceiverName == name
+                        select receiver;
+
+            receivers = web.Context.LoadQuery(query);
+            web.Context.ExecuteQuery();
+            if (receivers.Any())
+            {
+                return receivers.FirstOrDefault();
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        #endregion

         #region Localization
         /// <summary>


Changed IsAvailableForTagging to normal boolean instead of nullable

--- OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/Model/Term.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/Model/Term.cs
@@ -22,7 +22,7 @@
         public string Name { get; set; }
         public String Description { get; set; }
         public String Owner { get; set; }
-        public Boolean? IsAvailableForTagging { get; set; }
+        public Boolean IsAvailableForTagging { get; set; }
         public int? Language { get; set; }
         public String CustomSortOrder { get; set; }


Removed ReturnTheCorrectNumberOfPlanetsWithOneGravity as an invalid (incomplete, and therefore brittle) test and added some TestContext logging to the other 2 tests.

--- OneOffTestDemos/Bss.StarWars.Business.Test/PlanetLocator_Scout_Should.cs
+++ OneOffTestDemos/Bss.StarWars.Business.Test/PlanetLocator_Scout_Should.cs
@@ -10,6 +10,9 @@
     [TestClass]
     public class PlanetLocator_Scout_Should
     {
+        public TestContext TestContext { get; set; }
+
+
         [TestMethod]
         public void ReturnTheCorrectNumberOfPlanetsWithOneGravity()
         {
@@ -49,6 +52,8 @@
             for (int i = 0; i < planetCount; i++)
                 allPlanets.Add((null as Planet).Create());

+            TestContext.WriteLine("{0} planets in data store", allPlanets.Count());
+
             Rhino.Mocks
                 .Expect.Call(db.GetAllPlanets())
                 .Repeat.Any()
@@ -58,6 +63,7 @@

             var target = new Bss.StarWars.Business.PlanetLocator(db);
             var actual = target.Scout();
+            TestContext.WriteLine("{0} planets returned from target", actual.Count());

             foreach (var planet in actual)
                 Assert.IsTrue(planet.Gravity > 0.95);
@@ -76,6 +82,8 @@
             for (int i = 0; i < planetCount; i++)
                 allPlanets.Add((null as Planet).Create());

+            TestContext.WriteLine("{0} planets in data store", allPlanets.Count());
+
             Rhino.Mocks
                 .Expect.Call(db.GetAllPlanets())
                 .Repeat.Any()
@@ -85,6 +93,7 @@

             var target = new Bss.StarWars.Business.PlanetLocator(db);
             var actual = target.Scout();
+            TestContext.WriteLine("{0} planets returned from target", actual.Count());

             foreach (var planet in actual)
                 Assert.IsTrue(planet.Gravity < 1.05);