Refact MessageInfoParserTest

Refact MessageInfoParserTest

--- NetTelebot.Tests/ResponseTest/MessageInfoParserTest.cs
+++ NetTelebot.Tests/ResponseTest/MessageInfoParserTest.cs
@@ -15,10 +15,14 @@
     [TestFixture]
     internal static class MessageInfoParserTest
     {
-        private static readonly JObject mMandatoryFieldsMessageInfo =
+
+        #region Common object
+
+        private static JObject MCommonMandatoryFieldsMessageInfo { get; } =
             MessageInfoObject.GetMandatoryFieldsMessageInfo(-1147483648, 0,
                 1049413668, ChatType.@group);

+        //UserInfo
         private const int mId = 123;
         private const bool mIsBot = true;
         private const string mFirstName = "testName";
@@ -29,6 +33,7 @@
         private static JObject MCommonUserInfo { get;  } =
             UserInfoObject.GetObject(mId, mIsBot, mFirstName, mLastName, mUsername, mLanguageCode);

+        //PhotoSizeInfo
         private const string mFileId = "100";
         private const int mWidth = 100;
         private const int mHeight = 100;
@@ -36,6 +41,31 @@

         private static JObject MCommonPhotoSizeInfo { get; } =
             PhotoSizeInfoObject.GetObject(mFileId, mWidth, mHeight, mFileSize);
+
+        //ChatPhotoInfoObject
+        private const string mSmallField = "123456";
+        private const string mBigField = "654321";
+
+        private static JObject MCommonChatPhotoInfo { get; } = ChatPhotoInfoObject.GetObject(mSmallField, mBigField);
+
+        //ChatInfo
+        private const int mChatId = 1049413668;
+        private const string mType = "channel";
+        private const string mTitle = "TestTitle";
+        private const string mChatUsername = "TestUsername";
+        private const string mChatFirstName = "TestFirstName";
+        private const string mChatLastName = "TestLastName";
+        private const bool mAllMembersAreAdministrators = false;
+        private const string mDescription = "TestDescription";
+        private const string mInviteLink = "TestLink";
+
+
+        private static JObject MCommonChatInfo { get; } = ChatInfoObject.GetObject(mChatId, mType, mTitle, mChatUsername,
+            mChatFirstName, mChatLastName, mAllMembersAreAdministrators, MCommonChatPhotoInfo, mDescription, mInviteLink);
+
+        #endregion
+
+        #region Common assert method

         private static void AssertUserInfo(UserInfo userInfo)
         {
@@ -61,13 +91,42 @@
             });
         }

+        private static void AssertChatPhotoInfo(ChatPhotoInfo chatPhotoInfo)
+        {
+            Assert.Multiple(() =>
+            {
+                Assert.AreEqual(mBigField, chatPhotoInfo.BigFileId);
+                Assert.AreEqual(mSmallField, chatPhotoInfo.SmallFileId);
+            });
+        }
+
+        private static void AssertChatInfo(ChatInfo chatInfo)
+        {
+            Assert.Multiple(() =>
+            {
+                Assert.AreEqual(ChatType.channel, chatInfo.Type);
+                Assert.AreEqual(mChatId, chatInfo.Id);
+                Assert.AreEqual(mTitle, chatInfo.Title);
+                Assert.AreEqual(mChatUsername, chatInfo.Username);
+                Assert.AreEqual(mChatFirstName, chatInfo.FirstName);
+                Assert.AreEqual(mChatLastName, chatInfo.LastName);
+                Assert.AreEqual(mAllMembersAreAdministrators, chatInfo.AllMembersAreAdministrators);
+                Assert.AreEqual(mDescription, chatInfo.Description);
+                Assert.AreEqual(mInviteLink, chatInfo.InviteLink);
+
+                AssertChatPhotoInfo(chatInfo.Photo);
+            });
+        }
+
+        #endregion
+
         /// <summary>
         /// Test for <see cref="MessageInfo.From"/> parse field.
         /// </summary>
         [Test]
         public static void MessageInfoFromTest()
         {
-            dynamic messageInfoUser = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoUser = MCommonMandatoryFieldsMessageInfo;
             messageInfoUser.from = MCommonUserInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoUser);

@@ -80,7 +139,7 @@
         [Test]
         public static void MessageInfoForwardFromTest()
         {
-            dynamic messageInfoUser = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoUser = MCommonMandatoryFieldsMessageInfo;
             messageInfoUser.forward_from = MCommonUserInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoUser);

@@ -93,44 +152,11 @@
         [Test]
         public static void MessageInfoForwardFromChatTest()
         {
-            const int id = 1049413668;
-            const string type = "channel";
-            const string title = "TestTitle";
-            const string username = "TestUsername";
-            const string firstName = "TestFirstName";
-            const string lastName = "TestLastName";
-            const bool allMembersAreAdministrators = false;
-            JObject photo = ChatPhotoInfoObject.GetObject("123456", "654321");
-            const string description = "TestDescription";
-            const string inviteLink = "TestLink";
-
-            dynamic mandatoryMessageInfoFields = new JObject();
-
-            mandatoryMessageInfoFields.message_id = -1147483648;
-            mandatoryMessageInfoFields.date = 0;
-
-            mandatoryMessageInfoFields.chat = ChatInfoObject.GetMinimalMandatoryObject(id, ChatType.channel);
-
-            mandatoryMessageInfoFields.forward_from_chat = ChatInfoObject.GetObject(id, type,
-                title, username, firstName, lastName, allMembersAreAdministrators,
-                photo, description, inviteLink);
-
+            dynamic mandatoryMessageInfoFields = MCommonMandatoryFieldsMessageInfo;
+            mandatoryMessageInfoFields.forward_from_chat = MCommonChatInfo;
             MessageInfo messageInfo = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.Multiple(() =>
-            {
-                Assert.AreEqual(id, messageInfo.ForwardFromChat.Id, id);
-                Assert.AreEqual(ChatType.channel, messageInfo.ForwardFromChat.Type);
-                Assert.AreEqual(title, messageInfo.ForwardFromChat.Title, title);
-                Assert.AreEqual(username, messageInfo.ForwardFromChat.Username, username);
-                Assert.AreEqual(firstName, messageInfo.ForwardFromChat.FirstName, firstName);
-                Assert.AreEqual(lastName, messageInfo.ForwardFromChat.LastName, lastName);
-                Assert.AreEqual(allMembersAreAdministrators, messageInfo.ForwardFromChat.AllMembersAreAdministrators);
-                Assert.AreEqual("123456", messageInfo.ForwardFromChat.Photo.SmallFileId);
-                Assert.AreEqual("654321", messageInfo.ForwardFromChat.Photo.BigFileId);
-                Assert.AreEqual(description, messageInfo.ForwardFromChat.Description);
-                Assert.AreEqual(inviteLink, messageInfo.ForwardFromChat.InviteLink);
-            });
+            AssertChatInfo(messageInfo.ForwardFromChat);
         }

         /// <summary>
@@ -140,7 +166,7 @@
         public static void MessageInfoForwardFromMessageIdTest()
         {
             //check MessageInfo witout field [forward_from_message_id]
-            dynamic messageInfoForwardFromMessageId = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoForwardFromMessageId = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoForwardFromMessageId);
             Assert.AreEqual(0, messageInfo.ForwardFromMessageId);

@@ -157,7 +183,7 @@
         public static void MessageInfoForwardDateUnixTest()
         {
             //check MessageInfo without field [forward_date]
-            dynamic messageInfoForwardDateUnix = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoForwardDateUnix = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoForwardDateUnix);
             Assert.AreEqual(0, messageInfo.ForwardDateUnix);
             Assert.AreEqual(DateTime.MinValue, messageInfo.ForwardDate);
@@ -174,45 +200,11 @@
         [Test]
         public static void MessageInfoChatTest()
         {
-            const int id = 1049413668;
-            const string type = "channel";
-            const string title = "TestTitle";
-            const string username = "TestUsername";
-            const string firstName = "TestFirstName";
-            const string lastName = "TestLastName";
-            const bool allMembersAreAdministrators = false;
-
-            JObject photo = ChatPhotoInfoObject.GetObject("123456", "654321");
-            const string description = "TestDescription";
-            const string inviteLink = "TestLink";
-
-            dynamic mandatoryMessageInfoFields = new JObject();
-
-            mandatoryMessageInfoFields.message_id = -1147483648;
-            mandatoryMessageInfoFields.date = 0;
-
-            mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, type,
-                title, username, firstName, lastName, allMembersAreAdministrators,
-                photo, description, inviteLink);
-
+            dynamic mandatoryMessageInfoFields = MCommonMandatoryFieldsMessageInfo;
+            mandatoryMessageInfoFields.chat = MCommonChatInfo;
             MessageInfo messageInfo = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.Multiple(() =>
-            {
-                Assert.AreEqual(id, messageInfo.Chat.Id);
-                Assert.IsInstanceOf<long>(messageInfo.Chat.Id);
-
-                Assert.AreEqual(ChatType.channel, messageInfo.Chat.Type);
-                Assert.AreEqual(title, messageInfo.Chat.Title, title);
-                Assert.AreEqual(username, messageInfo.Chat.Username, username);
-                Assert.AreEqual(firstName, messageInfo.Chat.FirstName, firstName);
-                Assert.AreEqual(lastName, messageInfo.Chat.LastName, lastName);
-                Assert.AreEqual(allMembersAreAdministrators, messageInfo.Chat.AllMembersAreAdministrators);
-                Assert.AreEqual("123456", messageInfo.Chat.Photo.SmallFileId);
-                Assert.AreEqual("654321", messageInfo.Chat.Photo.BigFileId);
-                Assert.AreEqual(description, messageInfo.Chat.Description);
-                Assert.AreEqual(inviteLink, messageInfo.Chat.InviteLink);
-            });
+            AssertChatInfo(messageInfo.Chat);
         }

         /// <summary>
@@ -228,11 +220,8 @@
             const long idLongMax = long.MaxValue;

             const string type = "channel";
-
-            dynamic mandatoryMessageInfoFields = new JObject();
-
-            mandatoryMessageInfoFields.message_id = -1147483648;
-            mandatoryMessageInfoFields.date = 0;
+
+            dynamic mandatoryMessageInfoFields = MCommonMandatoryFieldsMessageInfo;

             //min_int
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(idIntMin, type);
@@ -262,44 +251,36 @@
         public static void MessageInfoChatsTypeParserTest()
         {
             const int id = 1049413668;
-            dynamic mandatoryMessageInfoFields = new JObject();
-
-            mandatoryMessageInfoFields.message_id = -1147483648;
-            mandatoryMessageInfoFields.date = 0;
+            dynamic mandatoryMessageInfoFields = MCommonMandatoryFieldsMessageInfo;

             //private
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, "private");
             MessageInfo messageInfo = new MessageInfo(mandatoryMessageInfoFields);
-
-            Assert.AreEqual(messageInfo.Chat.Id, id);
+
             Assert.AreEqual(ChatType.@private, messageInfo.Chat.Type);

             //channel
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, "channel");
             messageInfo = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.AreEqual(messageInfo.Chat.Id, id);
             Assert.AreEqual(ChatType.channel, messageInfo.Chat.Type);

             //group
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, "group");
             messageInfo = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.AreEqual(messageInfo.Chat.Id, id);
             Assert.AreEqual(ChatType.@group, messageInfo.Chat.Type);

             //supergroup
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, "supergroup");
             messageInfo = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.AreEqual(messageInfo.Chat.Id, id);
             Assert.AreEqual(ChatType.supergroup, messageInfo.Chat.Type);

             //null
             mandatoryMessageInfoFields.chat = ChatInfoObject.GetObject(id, "grou");
             MessageInfo messageInfo2 = new MessageInfo(mandatoryMessageInfoFields);

-            Assert.AreEqual(id, messageInfo2.Chat.Id);
             Assert.AreEqual(null, messageInfo2.Chat.Type);
         }

@@ -313,7 +294,7 @@
             const int date = 0;
             const int chatId = 125421;

-            dynamic messageInfoReplyToMessage = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoReplyToMessage = MCommonMandatoryFieldsMessageInfo;

             messageInfoReplyToMessage.reply_to_message = MessageInfoObject.GetMandatoryFieldsMessageInfo(messageId, date, chatId, ChatType.channel);

@@ -339,7 +320,7 @@
             const string url = "url";

             JObject user = MCommonUserInfo;
-            dynamic messageInfoEntities = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoEntities = MCommonMandatoryFieldsMessageInfo;
             messageInfoEntities.entities = new JArray(MessageEntityInfoObject.GetObject(type, offset, length, url, user));

             MessageInfo messageInfo = new MessageInfo(messageInfoEntities);
@@ -364,7 +345,7 @@
         public static void MessageInfoEditDateTest()
         {
             //check MessageInfo without field [edit_date]
-            dynamic messageInfoEditDate = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoEditDate = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoEditDate);

             Assert.AreEqual(0, messageInfo.EditDateUnix);
@@ -385,7 +366,7 @@
         public static void MessageInfoTextTest()
         {
             //check MessageInfo without field [text]
-            dynamic messageInfoText = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoText = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoText);
             Assert.AreEqual(string.Empty, messageInfo.Text);

@@ -408,7 +389,7 @@
             const string mimeType = "mimeTypeTest";
             const int fileSize = 10;

-            dynamic messageInfoAudio = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoAudio = MCommonMandatoryFieldsMessageInfo;

             messageInfoAudio.audio = AudioInfoObject.GetObject(fileId, duration, performer,
                 title, mimeType, fileSize);
@@ -438,7 +419,7 @@
             const string fileName = "testFleName";
             const int fileSize = 10;

-            dynamic messageInfoDocument = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoDocument = MCommonMandatoryFieldsMessageInfo;

             messageInfoDocument.document = DocumentInfoObject.GetObject(fileId,
                MCommonPhotoSizeInfo, fileName, mimeType, fileSize);
@@ -481,7 +462,7 @@
             const string url = "TestUrl";
             JArray entities = new JArray(MessageEntityInfoObject.GetObject(type, offset, length, url, MCommonUserInfo));

-            dynamic messageInfoGame = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoGame = MCommonMandatoryFieldsMessageInfo;

             messageInfoGame.game = GameInfoObject.GetObject(title, description, new JArray(MCommonPhotoSizeInfo), text, entities, animation);

@@ -523,7 +504,7 @@
         [Test]
         public static void MessageInfoPhotoTest()
         {
-            dynamic messageInfoPhoto = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoPhoto = MCommonMandatoryFieldsMessageInfo;
             messageInfoPhoto.photo = new JArray(MCommonPhotoSizeInfo);
             MessageInfo messageInfo = new MessageInfo(messageInfoPhoto);

@@ -542,7 +523,7 @@
             const string emoji = "emoji";
             const int fileSize = 10;

-            dynamic messageInfoSticker = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoSticker = MCommonMandatoryFieldsMessageInfo;

             messageInfoSticker.sticker = StickerInfoObject.GetObject(fileId, width, height,
                 MCommonPhotoSizeInfo, emoji, fileSize);
@@ -576,7 +557,7 @@
             const string mimeType = "mimeType";
             const int fileSize = 100;

-            dynamic messageInfoVideo = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoVideo = MCommonMandatoryFieldsMessageInfo;

             messageInfoVideo.video = VideoInfoObject.GetObject(fileId, width, height, duration,
                 MCommonPhotoSizeInfo, mimeType, fileSize);
@@ -609,7 +590,7 @@
             const string mimeType = "mimeTypeTest";
             const int fileSize = 10;

-            dynamic messageInfoVoice = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoVoice = MCommonMandatoryFieldsMessageInfo;

             messageInfoVoice.voice = VoiceInfoObject.GetObject(fileId, duration, mimeType, fileSize);

@@ -635,7 +616,7 @@
             const int duration = 100;
             const int fileSize = 10;

-            dynamic messageInfoVoice = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoVoice = MCommonMandatoryFieldsMessageInfo;

             messageInfoVoice.video_note = VideoNoteInfoObject.GetObject(
                 fileId, length, duration, MCommonPhotoSizeInfo, fileSize);
@@ -661,9 +642,8 @@
         [Test]
         public static void MessageInfoNewChatMembersTest()
         {
-            dynamic messageInfoUser = mMandatoryFieldsMessageInfo;
-            JArray membersArray = new JArray(MCommonUserInfo);
-            messageInfoUser.new_chat_members = membersArray;
+            dynamic messageInfoUser = MCommonMandatoryFieldsMessageInfo;
+            messageInfoUser.new_chat_members = new JArray(MCommonUserInfo);
             MessageInfo messageInfo = new MessageInfo(messageInfoUser);

             AssertUserInfo(messageInfo.NewChatMembers[0]);
@@ -676,7 +656,7 @@
         public static void MessageInfoCaptionTest()
         {
             //check MessageInfo without field [caption]
-            dynamic messageInfoCaption = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoCaption = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoCaption);
             Assert.AreEqual(string.Empty, messageInfo.Caption);

@@ -698,8 +678,7 @@
             const string lastName = "Test Last Name";
             const string userId = "0545006540";

-            dynamic messageInfoContact = mMandatoryFieldsMessageInfo;
-
+            dynamic messageInfoContact = MCommonMandatoryFieldsMessageInfo;
             messageInfoContact.contact = ContactInfoObject.GetObject(phoneNumber, firstName, lastName,
                 userId);

@@ -723,8 +702,7 @@
             const float longitude = 1000;
             const float latitude = 1000;

-            dynamic messageInfoLocation = mMandatoryFieldsMessageInfo;
-
+            dynamic messageInfoLocation = MCommonMandatoryFieldsMessageInfo;
             messageInfoLocation.location = LocationInfoObject.GetObject(longitude, latitude);

             MessageInfo messageInfo = new MessageInfo(messageInfoLocation);
@@ -750,8 +728,7 @@
             const string address = "TestAddress";
             const string foursquareId = "TestfoursquareId";

-            dynamic messageInfoVenue = mMandatoryFieldsMessageInfo;
-
+            dynamic messageInfoVenue = MCommonMandatoryFieldsMessageInfo;
             messageInfoVenue.venue = VenueInfoObject.GetObject(locationInfo, title, address, foursquareId);

             MessageInfo messageInfo = new MessageInfo(messageInfoVenue);
@@ -772,7 +749,7 @@
         [Test]
         public static void MessageInfoNewChatMemberTest()
         {
-            dynamic messageInfoUser = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoUser = MCommonMandatoryFieldsMessageInfo;
             messageInfoUser.new_chat_member = MCommonUserInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoUser);

@@ -785,7 +762,7 @@
         [Test]
         public static void MessageInfoLeftChatMemberTest()
         {
-            dynamic messageInfoUser = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoUser = MCommonMandatoryFieldsMessageInfo;
             messageInfoUser.left_chat_member = MCommonUserInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoUser);

@@ -799,7 +776,7 @@
         public static void MessageInfoNewChatTitleTest()
         {
             //check MessageInfo without field [new_chat_title]
-            dynamic messageInfoNewChatTitle = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoNewChatTitle = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoNewChatTitle);
             Assert.AreEqual(string.Empty, messageInfo.NewChatTitle);

@@ -815,7 +792,7 @@
         [Test]
         public static void MessageInfoNewChatPhotoTest()
         {
-            dynamic messageInfoNewChatPhoto = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoNewChatPhoto = MCommonMandatoryFieldsMessageInfo;
             messageInfoNewChatPhoto.new_chat_photo = new JArray(MCommonPhotoSizeInfo);
             MessageInfo messageInfo = new MessageInfo(messageInfoNewChatPhoto);

@@ -829,7 +806,7 @@
         public static void MessageInfoDeleteChatPhotoTest()
         {
             //check MessageInfo without field [delete_chat_photo]
-            dynamic deleteChatPhoto = mMandatoryFieldsMessageInfo;
+            dynamic deleteChatPhoto = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(deleteChatPhoto);
             Assert.False(messageInfo.DeleteChatPhoto);

@@ -846,7 +823,7 @@
         public static void MessageInfoGroupChatCreatedTest()
         {
             //check MessageInfo without field [group_chat_created]
-            dynamic groupChatCreated = mMandatoryFieldsMessageInfo;
+            dynamic groupChatCreated = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(groupChatCreated);
             Assert.False(messageInfo.GroupChatCreated);

@@ -863,7 +840,7 @@
         public static void MessageInfoSuperGroupChatCreatedTest()
         {
             //check MessageInfo without field [supergroup_chat_created]
-            dynamic superGroupChatCreated = mMandatoryFieldsMessageInfo;
+            dynamic superGroupChatCreated = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(superGroupChatCreated);
             Assert.False(messageInfo.SuperGroupChatCreated);

@@ -880,7 +857,7 @@
         public static void MessageInfoChannelChatCreatedTest()
         {
             //check MessageInfo without field [group_chat_created]
-            dynamic channelChatCreated = mMandatoryFieldsMessageInfo;
+            dynamic channelChatCreated = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(channelChatCreated);
             Assert.False(messageInfo.ChannelChatCreated);

@@ -897,7 +874,7 @@
         public static void MessageInfoMigrateToChatIdTest()
         {
             //check MessageInfo witout field [group_chat_created]
-            dynamic messageInfoMigrateToChatId = mMandatoryFieldsMessageInfo;
+            dynamic messageInfoMigrateToChatId = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(messageInfoMigrateToChatId);
             Assert.AreEqual(0, messageInfo.MigrateToChatId);

@@ -914,7 +891,7 @@
         public static void MessageInfoMigrateFromChatIdTest()
         {
             //check MessageInfo witout field [group_chat_created]
-            dynamic migrateFromChatId = mMandatoryFieldsMessageInfo;
+            dynamic migrateFromChatId = MCommonMandatoryFieldsMessageInfo;
             MessageInfo messageInfo = new MessageInfo(migrateFromChatId);
             Assert.AreEqual(0, messageInfo.MigrateFromChatId);

@@ -924,12 +901,10 @@
             Assert.AreEqual(14881488, messageInfo.MigrateFromChatId);
         }

-        [Test, Obsolete]
+        [Test]
         public static void MandatoryFieldsMessageInfoTest()
         {
-            dynamic mandatoryMessageInfoFields = mMandatoryFieldsMessageInfo;
-
-            MessageInfo messageInfo = new MessageInfo(mandatoryMessageInfoFields);
+            MessageInfo messageInfo = new MessageInfo(MCommonMandatoryFieldsMessageInfo);

             Assert.AreEqual(-1147483648, messageInfo.MessageId);
             Assert.AreEqual(0, messageInfo.DateUnix);
@@ -947,8 +922,7 @@
             const int date = 0;
             const int chatId = 125421;

-            dynamic messageInfoPinnedMessage = mMandatoryFieldsMessageInfo;
-
+            dynamic messageInfoPinnedMessage = MCommonMandatoryFieldsMessageInfo;
             messageInfoPinnedMessage.pinned_message = MessageInfoObject.GetMandatoryFieldsMessageInfo(messageId, date, chatId, ChatType.@group);

             MessageInfo messageInfo = new MessageInfo(messageInfoPinnedMessage);
@@ -971,10 +945,9 @@
             const string description = "TestDescription";
             const string startParameter = "TestStartParameter";
             const string currency = "USD";
-            const int totalAmount = 123;
-
-            dynamic messageInfoInvoice = mMandatoryFieldsMessageInfo;
-
+            const int totalAmount = 123;
+
+            dynamic messageInfoInvoice = MCommonMandatoryFieldsMessageInfo;
             messageInfoInvoice.invoice = InvoiceInfoObject.GetObject(title, description, startParameter,
                 currency, totalAmount);

@@ -1041,7 +1014,7 @@

             JObject orderInfo = OrderInfoObject.GetObject(name, phoneNumber, email, shippingAddress);

-            dynamic messageSuccessfulPayment = mMandatoryFieldsMessageInfo;
+            dynamic messageSuccessfulPayment = MCommonMandatoryFieldsMessageInfo;

             messageSuccessfulPayment.successful_payment = SuccessfulPaymentInfoObject.GetObject(currency, totalAmount,
                 invoicePayload, shippingOptionId, orderInfo, telegramPaymentChargeId, providerPaymentChargeId);


bugfix all waiting processes need to be in the initial waiting collection

--- processing/ProcessChain.cs
+++ processing/ProcessChain.cs
@@ -50,7 +50,7 @@
                 p.Ended += ProcessEndedHandler;
             }

-            WaitingProcesses = new ObservableCollection<IProcess>(CollectWaitingProcesses());
+            WaitingProcesses = new ObservableCollection<IProcess>(processes);
             RunningProcesses = new ObservableCollection<IProcess>();
             EndedProcesses = new ObservableCollection<IProcess>();
         }


Remove unnecessary target dependency.

Remove unnecessary target dependency.

--- build/Build.cs
+++ build/Build.cs
@@ -97,5 +97,5 @@
             });

     Target Full => _ => _
-            .DependsOn(Compile, Test, Analysis, Push);
+            .DependsOn(Test, Analysis, Push);
 }


Minor cleanup

Minor cleanup

--- build/Build.cs
+++ build/Build.cs
@@ -1,8 +1,8 @@
 using System;
 using Nuke.Common;
-using Nuke.Common.CI;
 using Nuke.Common.CI.AppVeyor;
 using Nuke.Common.CI.AzurePipelines;
+using Nuke.Common.CI.GitHubActions;
 using Nuke.Common.Execution;
 using Nuke.Common.IO;
 using Nuke.Common.ProjectModel;
@@ -60,10 +60,10 @@
     [Parameter("Enable coverlet diagnostics (log.*.txt)")]
     readonly bool CoverletDiag;

-    [Parameter("Is CI Build (AppVeyor)")]
-    readonly bool IsCiBuild = Host == HostType.AppVeyor;
+    [Parameter("Is CI Build")]
+    readonly bool IsCiBuild = Host is GitHubActions;
     [Parameter("Push built NuGet package")]
-    readonly bool IsPushTag = (Environment.GetEnvironmentVariable("APPVEYOR_REPO_TAG") ?? "-unset-") == "true";
+    readonly bool IsPushTag = (Environment.GetEnvironmentVariable("GITHUB_REF") ?? "-unset-").StartsWith("refs/tags/");

     [Parameter("NuGet API Key")]
     readonly string NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
@@ -118,7 +118,7 @@
                 .SetConfiguration(Configuration)
                 .EnableNoBuild()
                 .EnableBlameMode()
-                .SetLogger("trx")
+                .AddLoggers("trx")
                 .EnableCollectCoverage()
                 .SetDataCollector("XPlat Code Coverage")
                 .SetSettingsFile("coverage.runsettings")


Changes to the parameters we pass to PineZorro, including the new install path for the Willow-installed VS instance of node.exe

--- Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs
+++ Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs
@@ -350,10 +350,16 @@

             var setupConfiguration = new SetupConfiguration();

-            var visualStudioInstallationInstanceID = setupConfiguration.GetInstanceForCurrentProcess().GetInstanceId();
+            var setupInstance = setupConfiguration.GetInstanceForCurrentProcess();
+
+            var visualStudioInstallationInstanceID = setupInstance.GetInstanceId();
+
+            var pathToNodeExe = setupInstance.GetInstallationPath() + "\\JavaScript\\Node.JS\\v6.4.0_x86\\Node.exe";

             var pathToNode2DebugAdapterRuntime = Environment.ExpandEnvironmentVariables(@"""%ALLUSERSPROFILE%\" +
                     $@"Microsoft\VisualStudio\NodeAdapter\{visualStudioInstallationInstanceID}\extension\out\src\nodeDebug.js""");
+
+            var adapterString = pathToNodeExe + " " + pathToNode2DebugAdapterRuntime;

             var cwd = _project.GetWorkingDirectory(); // Current working directory
             var configuration = new JObject(
@@ -366,8 +372,7 @@
                 new JProperty("diagnosticLogging", CheckEnableDiagnosticLoggingOption()),
                 new JProperty("sourceMaps", true),
                 new JProperty("stopOnEntry", true),
-                new JProperty("$adapter", pathToNode2DebugAdapterRuntime),
-                new JProperty("$adapterRuntime", "node"));
+                new JProperty("$adapter", pathToNode2DebugAdapterRuntime));

             var jsonContent = configuration.ToString();


Make gatekeeper's address check case-insensitive.

--- OpenSim/Services/HypergridService/GatekeeperService.cs
+++ OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -333,7 +333,8 @@

             string addressee = parts[0];
             m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, m_ExternalName);
-            return (addressee == m_ExternalName);
+
+            return string.Equals(addressee, m_ExternalName, StringComparison.OrdinalIgnoreCase);
         }

         #endregion


Fix a regression from d58ab5b2.

Fix a regression from d58ab5b2.

The re-editable tools can adjust the history after saving (e.g. undoing a "Finalize" history item that was done when committing the changes), so we need to carefully ensure that the document isn't stuck in a dirty state immediately after saving.

Fixes: 1909752

--- Pinta/Actions/File/SaveDocumentImplementationAction.cs
+++ Pinta/Actions/File/SaveDocumentImplementationAction.cs
@@ -222,9 +222,12 @@
 			}

 			document.Filename = Path.GetFileName (file);
-			document.Workspace.History.SetClean();

 			PintaCore.Tools.CurrentTool.DoAfterSave();
+
+			// Mark the document as clean following the tool's after-save handler, which might
+			// adjust history (e.g. undo changes that were committed before saving).
+			document.Workspace.History.SetClean ();

 			//Now the Document has been saved to the file it's associated with in this session.
 			document.HasBeenSavedInSession = true;


virtual key as constructor

virtual key as constructor

--- PostageStampTransactionHelper/ViewModel/TradingItem.cs
+++ PostageStampTransactionHelper/ViewModel/TradingItem.cs
@@ -10,9 +10,9 @@

         private float _tradingPrice;

-        public TradingItem(string shutCutKey)
+        public TradingItem(uint virtualKey)
         {
-            ShutCutKey = shutCutKey;
+            ShortCutKey = virtualKey;
         }

         public float Price
@@ -57,7 +57,7 @@
             }
         }

-        public string ShutCutKey { get; }
+        public uint ShortCutKey { get; }

         public event PropertyChangedEventHandler PropertyChanged;


Changed WebDirectoryRepository methods to virtual.

--- Projects/WebMagic/Repository/WebDirectoryRepository.cs
+++ Projects/WebMagic/Repository/WebDirectoryRepository.cs
@@ -22,7 +22,7 @@
         ///     true if the directory exists in the virtual file system; otherwise, false.
         /// </returns>
         /// <exception cref="System.NotImplementedException"></exception>
-        public bool DirectoryExists(string directory)
+        public virtual bool DirectoryExists(string directory)
         {
             LogTo.Warn("DirectoryExists(directory: {0}) is not supported.", directory);
             return false;
@@ -38,7 +38,7 @@
         /// </returns>
         /// <exception cref="System.NotImplementedException"></exception>
         [return: AllowNull]
-        public VirtualDirectory GetDirectory(string directory)
+        public virtual VirtualDirectory GetDirectory(string directory)
         {
             LogTo.Warn("GetDirectory(directory: {0}) is not supported. todo: Why is this being called if DirectoryExists() returns false?", directory);
             return null;
@@ -53,7 +53,7 @@
         ///     file system.
         /// </returns>
         /// <exception cref="System.NotImplementedException"></exception>
-        public VirtualFile GetFile(string path)
+        public virtual VirtualFile GetFile(string path)
         {
             return new RepositoryVirtualFile(path, this);
         }
@@ -66,7 +66,7 @@
         ///     true if the file exists in the virtual file system; otherwise, false.
         /// </returns>
         /// <exception cref="System.NotImplementedException"></exception>
-        public bool FileExists(string path)
+        public virtual bool FileExists(string path)
         {
             var fileName = GetFullPath(path);
             var exists = File.Exists(fileName);
@@ -76,14 +76,14 @@
             return exists;
         }

-        public Stream OpenStream(string path)
+        public virtual Stream OpenStream(string path)
         {
             var fileName = GetFullPath(path);

             return File.OpenRead(fileName);
         }

-        private string GetFullPath(string path)
+        protected virtual string GetFullPath(string path)
         {
             return Path.Combine(RootDirectory, path);
         }


[V2] Fixing where the source filepath is specified for VC command lines

--- packages/VisualC/12.0/Scripts/CCompilerOptionCollection.cs
+++ packages/VisualC/12.0/Scripts/CCompilerOptionCollection.cs
@@ -84,10 +84,10 @@
             switch (options.TargetLanguage)
             {
                 case C.ETargetLanguage.C:
-                    commandLine.Add("-Tc");
+                    commandLine.Add(System.String.Format("-Tc {0}", objectFile.InputPath.ToString()));
                     break;
                 case C.ETargetLanguage.Cxx:
-                    commandLine.Add("-Tp");
+                    commandLine.Add(System.String.Format("-Tp {0}", objectFile.InputPath.ToString()));
                     break;
                 default:
                     throw new Bam.Core.Exception("Unsupported target language");
@@ -99,11 +99,11 @@
             switch (options.OutputType)
             {
                 case C.ECompilerOutput.CompileOnly:
-                    commandLine.Add(System.String.Format("-c {0}", objectFile.InputPath.ToString()));
+                    commandLine.Add("-c");
                     commandLine.Add(System.String.Format("-Fo{0}", module.GeneratedPaths[C.V2.ObjectFile.Key].ToString()));
                     break;
                 case C.ECompilerOutput.Preprocess:
-                    commandLine.Add(System.String.Format("-E {0}", objectFile.InputPath.ToString()));
+                    commandLine.Add("-E");
                     commandLine.Add(System.String.Format("-Fo{0}", module.GeneratedPaths[C.V2.ObjectFile.Key].ToString()));
                     break;
             }


fix selenium tests

fix selenium tests

--- Spa2/NakedObjects.Spa.Selenium.Test/tests/LocalCollectionActions.cs
+++ Spa2/NakedObjects.Spa.Selenium.Test/tests/LocalCollectionActions.cs
@@ -23,6 +23,8 @@
             GeminiUrl("object?i1=View&r=1&o1=___1.SalesOrderHeader--44284&c1_Details=List");
             WaitForCss("input[type='checkbox']", 17); // 16 lines plus all
             WaitForSelectedCheckboxes(0);
+
+            br.SwitchTo().ActiveElement().SendKeys(Keys.PageDown + Keys.PageDown);
             SelectCheckBox("input[type = 'checkbox']#details1-0");
             SelectCheckBox("input[type = 'checkbox']#details1-2");
             SelectCheckBox("input[type = 'checkbox']#details1-7");


propperly nullify test container

propperly nullify test container

--- RequestReduce.Facts/Module/ResponseTransformerFacts.cs
+++ RequestReduce.Facts/Module/ResponseTransformerFacts.cs
@@ -595,6 +595,7 @@
                 var result = testable.ClassUnderTest.Transform(transform);

                 Assert.Equal(transformed, result);
+                RRContainer.Current = null;
             }

             [Fact]


20000006-748 #34 - Corrigido o carregamento da lista de escolas para a usuários administradores de uma DRE.

--- Src/GestaoEscolar/Academico/ControleTurma/MinhaEscolaGestor.aspx.cs
+++ Src/GestaoEscolar/Academico/ControleTurma/MinhaEscolaGestor.aspx.cs
@@ -355,6 +355,10 @@
                         lblMensagem.Text = message;

                     UCComboUAEscola1.Inicializar();
+                    if (UCComboUAEscola1.Uad_ID != Guid.Empty)
+                    {
+                        UCComboUAEscola1_IndexChangedUA();
+                    }

                     if (UCComboUAEscola1.Esc_ID > 0 && UCComboUAEscola1.QuantidadeItemsComboEscolas == 2)
                     {


Mark long-running LogBoxTest as explicit

When running the long-running LogBoxTest on Linux the system
stops responding while the test runs because it uses up all available
memory. The [Explicit] attribute will only run the test when
selected. This should improve the DX for the normal developer :-)

--- SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
+++ SIL.Windows.Forms.Tests/Progress/LogBox/LogBoxTests.cs
@@ -32,6 +32,7 @@
 		}

 		[Test]
+		[Explicit]
 		[Category("LongRunning")]
 		[Category("SkipOnTeamCity")]
 		public void WriteVerbose_AtMaximumLength_RtfContainsMaximumLengthExceeded()


Refactored PhoneNumberFilterTests to use the abstract FilterTestsBase class.

--- SharpRaven.UnitTests/Logging/PhoneNumberFilterTests.cs
+++ SharpRaven.UnitTests/Logging/PhoneNumberFilterTests.cs
@@ -1,41 +1,23 @@
-using System;
-
-using NUnit.Framework;
+using NUnit.Framework;

 using SharpRaven.Logging.Filters;

 namespace SharpRaven.UnitTests.Logging
 {
     [TestFixture]
-    public class PhoneNumberFilterTests
+    public class PhoneNumberFilterTests : FilterTestsBase<PhoneNumberFilter>
     {
         [Test]
         public void InvalidPhoneNumber_IsNotScrubbed()
         {
-            const string phoneNumber = "1531";
-            var input = String.Format(
-                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. {0} Praesent est dui, ornare eget condimentum a, tincidunt sit amet lectus. Nulla pellentesque, tortor eget tempus malesuada.",
-                phoneNumber);
-
-            PhoneNumberFilter filter = new PhoneNumberFilter();
-            var output = filter.Filter(input);
-
-            Assert.That(output, Is.StringContaining(phoneNumber));
+            base.InvalidValueIsNotScrubbed("1531");
         }

         [Test]
         public void ValidPhoneNumber_IsScrubbed()
         {
-            const string phoneNumber = "55518231234";
-            var input = String.Format(
-                "Lorem ipsum dolor sit amet, consectetur adipiscing elit. {0} Praesent est dui, ornare eget condimentum a, tincidunt sit amet lectus. Nulla pellentesque, tortor eget tempus malesuada.",
-                phoneNumber);
-
-            PhoneNumberFilter filter = new PhoneNumberFilter();
-            var output = filter.Filter(input);
-
-            Assert.That(output, Is.Not.StringContaining(phoneNumber));
+            ValidValueIsScrubbed("55518231234");
         }
     }
 }


add wallets when wallet added is called.

--- WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -53,6 +53,13 @@
 							OpenClosedWallet(cwvm);
 						}
 					}
+				});
+
+			Observable.FromEventPattern<Wallet>(WalletManager, nameof(WalletManager.WalletAdded))
+				.ObserveOn(RxApp.MainThreadScheduler)
+				.Subscribe(x =>
+				{
+					Wallets.InsertSorted(new ClosedWalletViewModel(x.EventArgs));
 				});

 			var shell = IoC.Get<IShell>();


load all wallets.

load all wallets.

--- WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -6,7 +6,6 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Composition;
-using System.IO;
 using System.Linq;
 using WalletWasabi.Gui.ViewModels;
 using WalletWasabi.Wallets;
@@ -95,10 +94,7 @@

 		private void LoadWallets()
 		{
-			foreach (var wallet in WalletManager
-				.GetKeyManagers()
-				.Where(x => !x.IsWatchOnly)) // If password isn't required then add the wallet, otherwise add only not watchonly wallets.
-
+			foreach (var wallet in WalletManager.GetKeyManagers())
 			{
 				Wallets.InsertSorted(new ClosedWalletViewModel(WalletManager.GetWalletByName(wallet.WalletName)));
 			}


Ignore line endings when verifying multipart content

--- WebAnchor.Tests/Wiki/BuildingAnHttpRequest/MultipartContentTests.cs
+++ WebAnchor.Tests/Wiki/BuildingAnHttpRequest/MultipartContentTests.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Net.Http;
 using System.Text;
 using System.Threading.Tasks;
@@ -32,17 +33,17 @@
             TestTheRequest<IApi>(
                api => api.PostSingleMultipart(new StringContentPart("Content", "Field1", "test.txt") { ContentType = "text/plain" }),
                assertMe =>
-               {
-                   Assert.Equal(HttpMethod.Post, assertMe.Method);
-                   Assert.Equal("api", assertMe.RequestUri.ToString());
-                   var body = assertMe.Content.ReadAsStringAsync().Result;
-                   Assert.Matches(@"--(?<id>[0-9a-f\-]*)
+                   {
+                       VerifyMultipartRequest(
+                           assertMe,
+                           @"--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 Content
---\k<id>--", body);
-               });
+--{boundary}--
+");
+                   });
         }

         [Fact]
@@ -54,15 +55,15 @@
                 api => api.PostSingleMultipart(new StreamContentPart(stream, "Field1", "test.txt") { ContentType = "text/plain" }),
                 assertMe =>
                     {
-                        Assert.Equal(HttpMethod.Post, assertMe.Method);
-                        Assert.Equal("api", assertMe.RequestUri.ToString());
-                        var body = assertMe.Content.ReadAsStringAsync().Result;
-                        Assert.Matches(@"--(?<id>[0-9a-f\-]*)
+                        VerifyMultipartRequest(
+                            assertMe,
+                            @"--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 From a stream
---\k<id>--", body);
+--{boundary}--
+");
                     });
         }

@@ -73,15 +74,15 @@
                 api => api.PostSingleMultipart(new ByteArrayContentPart(Encoding.UTF8.GetBytes("From bytes"), "Field1", "test.txt") { ContentType = "text/plain" }),
                 assertMe =>
                     {
-                        Assert.Equal(HttpMethod.Post, assertMe.Method);
-                        Assert.Equal("api", assertMe.RequestUri.ToString());
-                        var body = assertMe.Content.ReadAsStringAsync().Result;
-                        Assert.Matches(@"--(?<id>[0-9a-f\-]*)
+                        VerifyMultipartRequest(
+                             assertMe,
+                             @"--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 From bytes
---\k<id>--", body);
+--{boundary}--
+");
                     });
         }

@@ -94,20 +95,20 @@
                     new ByteArrayContentPart(Encoding.UTF8.GetBytes("From bytes"), "Field1", "test.txt") { ContentType = "text/plain" }),
                 assertMe =>
                     {
-                        Assert.Equal(HttpMethod.Post, assertMe.Method);
-                        Assert.Equal("api", assertMe.RequestUri.ToString());
-                        var body = assertMe.Content.ReadAsStringAsync().Result;
-                        Assert.Matches(@"--(?<id>[0-9a-f\-]*)
+                        VerifyMultipartRequest(
+                            assertMe,
+                            @"--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 Content
---\k<id>
+--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 From bytes
---\k<id>--", body);
+--{boundary}--
+");
                     });
         }

@@ -124,21 +125,37 @@
                 api => api.PostListMultipart(listData),
                 assertMe =>
                     {
-                        Assert.Equal(HttpMethod.Post, assertMe.Method);
-                        Assert.Equal("api", assertMe.RequestUri.ToString());
-                        var body = assertMe.Content.ReadAsStringAsync().Result;
-                        Assert.Matches(@"--(?<id>[0-9a-f\-]*)
+                        VerifyMultipartRequest(
+                            assertMe,
+                            @"--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 Content
---\k<id>
+--{boundary}
 Content-Type: text/plain
-Content-Disposition: form-data; name=Field1; filename=test\.txt; filename\*=utf-8''test\.txt
+Content-Disposition: form-data; name=Field1; filename=test.txt; filename*=utf-8''test.txt

 From bytes
---\k<id>--", body);
+--{boundary}--
+");
                     });
+        }
+
+        private static void VerifyMultipartRequest(HttpRequestMessage assertMe, string expectedContent)
+        {
+            Assert.Equal(HttpMethod.Post, assertMe.Method);
+            Assert.Equal("api", assertMe.RequestUri.ToString());
+
+            var boundary = assertMe.Content.Headers.ContentType.Parameters.SingleOrDefault(p => p.Name == "boundary")?.Value;
+            Assert.NotNull(boundary);
+            Assert.Matches(@"^""[0-9A-Fa-f]{8}[-]?([0-9A-Fa-f]{4}[-]?){3}[0-9A-Fa-f]{12}""$", boundary);
+
+            var body = assertMe.Content.ReadAsStringAsync().Result;
+            Assert.Equal(
+                expectedContent.Replace("{boundary}", boundary.Trim('"')),
+                body,
+                ignoreLineEndingDifferences: true);
         }

         public class Post


write additional parameters to textbox

write additional parameters to textbox

--- SignalR.ConnectionManager/HubTest.UWP/MainPage.xaml.cs
+++ SignalR.ConnectionManager/HubTest.UWP/MainPage.xaml.cs
@@ -51,7 +51,7 @@
         private void SubOnReceived(IList<JToken> list)
         {
             Debug.WriteLine("SubOnReceived");
-            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => textBox.Text += "SubOnReceived\n\r");
+            Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => textBox.Text += String.Format("SubOnReceived {0} {1} {2} {3} {4}\n\r", list[0], list[1], list[2], list[3], list[4]));
         }

         private void button_Click(object sender, RoutedEventArgs e)


control panel test fix

control panel test fix

--- Signum.Web.Extensions.Sample.Test/ControlPanelTests.cs
+++ Signum.Web.Extensions.Sample.Test/ControlPanelTests.cs
@@ -96,9 +96,9 @@
             selenium.Type(part2 + "Title", "My Links");
             CreateLinkListPartItem(selenium, part2, 0, "Best Band", "http://localhost/Signum.Web.Extensions.Sample/View/Band/1");
             CreateLinkListPartItem(selenium, part2, 1, "Best Artist", "http://localhost/Signum.Web.Extensions.Sample/View/Artist/1");
-            selenium.MouseDown("jq=#sfCpAdminContainer td[data-column=1] .sf-cp-part:eq(2)");
-            selenium.MouseMove("jq=#sfCpAdminContainer td[data-column=2] .sf-cp-droppable");
-            selenium.MouseUp("jq=#sfCpAdminContainer td[data-column=2] .sf-cp-droppable");
+            selenium.MouseDown("jq=#sfCpAdminContainer td[data-column=1] .sf-ftbl-part:eq(2)");
+            selenium.MouseMove("jq=#sfCpAdminContainer td[data-column=2] .sf-ftbl-droppable");
+            selenium.MouseUp("jq=#sfCpAdminContainer td[data-column=2] .sf-ftbl-droppable");

             selenium.EntityButtonSaveClick();
             selenium.WaitForPageToLoad(PageLoadTimeout);


fix default text CountSearchControl

fix default text CountSearchControl

--- Signum.Windows/DynamicQuery/CountSearchControl.xaml.cs
+++ Signum.Windows/DynamicQuery/CountSearchControl.xaml.cs
@@ -157,10 +157,9 @@
                 }
                 else
                 {
-                    FormattedText = (Text ?? "{1}: {0}")
-                        .Formato(ItemsCount, QueryUtils.GetNiceName(QueryName));
+                    FormattedText = (Text ?? (QueryUtils.GetNiceName(QueryName) + ": {0}"))
+                        .Formato(ItemsCount);
                     tb.FontWeight = FontWeights.Bold;
-
                 }
             },
             () => { });


Particle by default has a bigger simulation step (slightly less accuracy; slightly less processing)

--- SimpleScene/Meshes/ParticleSystems/SSParticleSystem.cs
+++ SimpleScene/Meshes/ParticleSystems/SSParticleSystem.cs
@@ -71,7 +71,7 @@
 		/// Defines a unit step for the thic particle system's simulation.
 		/// Higher values result in a more quanitized simulation but more processing
 		/// </summary>
-        public float simulationStep = .010f;
+        public float simulationStep = .025f;

         // TODO bounding sphere or cube
         protected List<SSParticleEmitter> _emitters = new List<SSParticleEmitter> ();


Fixed detection of voltage channels in the SELEVEReader.

--- Source/Libraries/FaultData/DataReaders/SELEVEReader.cs
+++ Source/Libraries/FaultData/DataReaders/SELEVEReader.cs
@@ -115,7 +115,7 @@
                         .Zip(valueSamples, (time, value) => new DataPoint() { Time = time, Value = value })
                         .ToList();

-                    if (channel.MeasurementType.Name == "Voltage")
+                    if (new string[] { "VA", "VB", "VC" }.Contains(report.AnalogSection.AnalogChannels[i].Name))
                         meterDataSet.DataSeries.Add(series.Multiply(1000.0));
                     else
                         meterDataSet.DataSeries.Add(series);


- Some minor code refactoring to decrease code depth

--- Source/Mosa.Runtime/Metadata/Runtime/CilGenericType.cs
+++ Source/Mosa.Runtime/Metadata/Runtime/CilGenericType.cs
@@ -162,34 +162,29 @@
 				if (!type.ContainsGenericParameters)
 				{
 					result.Add(type);
+                    continue;
 				}
-				else
+				// find the enclosed type
+				foreach (RuntimeType runtimetype in ModuleTypeSystem.GetAllTypes())
 				{
-					// find the enclosed type
-					foreach (RuntimeType runtimetype in ModuleTypeSystem.GetAllTypes())
+					if (runtimetype.IsInterface)
 					{
-						if (runtimetype.IsInterface)
+						CilGenericType runtimetypegeneric = runtimetype as CilGenericType;
+                        if (runtimetypegeneric == null)
+                            continue;
+                        if (type != runtimetypegeneric.genericType)
+                            continue;
+						// FIXME
+						if (signature == runtimetypegeneric.signature)
 						{
-							CilGenericType runtimetypegeneric = runtimetype as CilGenericType;
-							if (runtimetypegeneric != null)
-								// FIXME
-								if (type == runtimetypegeneric.genericType)
-									if (signature == runtimetypegeneric.signature)
-									{
-										result.Add(runtimetype);
-										break;
-									}
+							result.Add(runtimetype);
+							break;
 						}
 					}
 				}
 			}

-			if (result.Count != 0)
-			{
-				return result;
-			}
-
-			return NoInterfaces;
+			return result.Count != 0 ? result : NoInterfaces;
 		}
 	}
 }


Fix memoryPattern output never reseting

Fix memoryPattern output never reseting

--- plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
+++ plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
@@ -87,7 +87,7 @@

         private void ResetOutput()
         {
-
+            SendData(true);
         }

         private void SendData(bool emptyPatterns = false)
@@ -103,6 +103,7 @@
                     if (emptyPatterns)
                     {
                         SetOutput(pattern, "   ");
+                        output[pattern.Name] = "   ";
                         continue;
                     }


Add OpenAPI description

Add OpenAPI description

--- src/Tgstation.Server.Host/Core/SwaggerConfiguration.cs
+++ src/Tgstation.Server.Host/Core/SwaggerConfiguration.cs
@@ -138,7 +138,8 @@
 					{
 						Name = "/tg/station 13",
 						Url = new Uri("https://github.com/tgstation")
-					}
+					},
+					Description = "A production scale tool for BYOND server management"
 				});

 			// Important to do this before applying our own filters


labels in data for bar graph

labels in data for bar graph

--- src/TwitterStats/TwitterStats/Models/StatsViewModel.cs
+++ src/TwitterStats/TwitterStats/Models/StatsViewModel.cs
@@ -89,7 +89,7 @@
                 var competitors = retweets.Sum(rt => rt.RetweetedStatus.RetweetCount) / retweets.Count();

                 DailyTweets.Add(new { date=day.Key, tweets=tweets.Count(), retweets=retweets.Count() });
-                DailyCompetitors.Add(new { date = day.Key, competitors });
+                DailyCompetitors.Add(new { date = day.Key, competitors, label = day.Key });
             }
         }


Added support for all 4 cases in ContentVariantMapper

--- src/Umbraco.Web/Models/Mapping/ContentVariantMapper.cs
+++ src/Umbraco.Web/Models/Mapping/ContentVariantMapper.cs
@@ -21,99 +21,110 @@

         public IEnumerable<ContentVariantDisplay> Map(IContent source, MapperContext context)
         {
-            var variants = new List<ContentVariantDisplay>();
-
             var variesByCulture = source.ContentType.VariesByCulture();
             var variesBySegment = source.ContentType.VariesBySegment();

+            IList<ContentVariantDisplay> variants = new List<ContentVariantDisplay>();
+
             if (!variesByCulture && !variesBySegment)
             {
-                //this is invariant so just map the IContent instance to ContentVariationDisplay
-                variants.Add(context.Map<ContentVariantDisplay>(source));
-                return variants;
+                // this is invariant so just map the IContent instance to ContentVariationDisplay
+                var variantDisplay = context.Map<ContentVariantDisplay>(source);
+                variants.Add(variantDisplay);
             }
-
-            if (variesByCulture && !variesBySegment)
+            else if (variesByCulture && !variesBySegment)
             {
-                // Culture only
-
-                var allLanguages = _localizationService.GetAllLanguages().OrderBy(x => x.Id).ToList();
-                if (allLanguages.Count == 0) return Enumerable.Empty<ContentVariantDisplay>(); //this should never happen
-
-                var langs = context.MapEnumerable<ILanguage, Language>(allLanguages).ToList();
-
-                //create a variant for each language, then we'll populate the values
-                variants.AddRange(langs.Select(x =>
-                {
-                    //We need to set the culture in the mapping context since this is needed to ensure that the correct property values
-                    //are resolved during the mapping
-                    context.SetCulture(x.IsoCode);
-                    return context.Map<ContentVariantDisplay>(source);
-                }));
-
-                for (int i = 0; i < langs.Count; i++)
-                {
-                    var x = langs[i];
-                    var variant = variants[i];
-
-                    variant.Language = x;
-                    variant.Name = source.GetCultureName(x.IsoCode);
-                }
-
-                //Put the default language first in the list & then sort rest by a-z
-                var defaultLang = variants.SingleOrDefault(x => x.Language.IsDefault);
-
-                //Remove the default language from the list for now
-                variants.Remove(defaultLang);
-
-                //Sort the remaining languages a-z
-                variants = variants.OrderBy(x => x.Language.Name).ToList();
-
-                //Insert the default language as the first item
-                variants.Insert(0, defaultLang);
+                var languages = GetLanguages(context);
+                variants = languages
+                    .Select(language => CreateVariantDisplay(context, source, language, null))
+                    .ToList();
             }
             else if (variesBySegment && !variesByCulture)
             {
                 // Segment only
-                throw new NotSupportedException("ContentVariantMapper not implemented for segment only!");
+                var segments = GetSegments(source);
+                variants = segments
+                    .Select(segment => CreateVariantDisplay(context, source, null, segment))
+                    .ToList();
             }
             else
             {
                 // Culture and segment
+                var languages = GetLanguages(context).ToList();
+                var segments = GetSegments(source).ToList();

-                var allLanguages = _localizationService.GetAllLanguages().OrderBy(x => x.Id).ToList();
-                if (allLanguages.Count == 0) return Enumerable.Empty<ContentVariantDisplay>(); //this should never happen
-
-                var langs = context.MapEnumerable<ILanguage, Language>(allLanguages).ToList();
-
-                // All segments, including the unsegmented (= NULL) segment.
-                // TODO: The NULl segment might have to be changed to be empty string?
-                var segments = source.Properties
-                    .SelectMany(p => p.Values.Select(v => v.Segment))
-                    .Distinct();
-
-                // Add all variants
-                foreach (var language in langs)
+                if (languages.Count == 0 || segments.Count == 0)
                 {
-                    foreach (var segment in segments)
-                    {
-                        context.SetCulture(language.IsoCode);
-                        context.SetSegment(segment);
-
-                        var variantDisplay = context.Map<ContentVariantDisplay>(source);
-
-                        variantDisplay.Language = language;
-                        variantDisplay.Segment = segment;
-                        variantDisplay.Name = source.GetCultureName(language.IsoCode);
-
-                        variants.Add(variantDisplay);
-                    }
+                    // This should not happen
+                    throw new ArgumentException("No languages or segments available");
                 }

-                // TODO: Sorting
+                variants = languages
+                    .SelectMany(language => segments
+                        .Select(segment => CreateVariantDisplay(context, source, language, segment)))
+                    .ToList();
             }

-            return variants;
+            return SortVariants(variants);
+        }
+
+        private IList<ContentVariantDisplay> SortVariants(IList<ContentVariantDisplay> variants)
+        {
+            if (variants == null || variants.Count <= 1)
+            {
+                return variants;
+            }
+
+            // Default variant first, then order by language, segment.
+            return variants
+                .OrderBy(v => IsDefaultLanguage(v) ? 0 : 1)
+                .ThenBy(v => IsDefaultSegment(v) ? 0 : 1)
+                .ThenBy(v => v?.Language?.Name)
+                .ThenBy(v => v.Segment)
+                .ToList();
+        }
+
+        private static bool IsDefaultSegment(ContentVariantDisplay variant)
+        {
+            return variant.Segment == null;
+        }
+
+        private static bool IsDefaultLanguage(ContentVariantDisplay variant)
+        {
+            return variant.Language == null || variant.Language.IsDefault;
+        }
+
+        private IEnumerable<Language> GetLanguages(MapperContext context)
+        {
+            var allLanguages = _localizationService.GetAllLanguages().OrderBy(x => x.Id).ToList();
+            if (allLanguages.Count == 0)
+            {
+                // This should never happen
+                return Enumerable.Empty<Language>();
+            }
+            else
+            {
+                return context.MapEnumerable<ILanguage, Language>(allLanguages).ToList();
+            }
+        }
+
+        private IEnumerable<string> GetSegments(IContent content)
+        {
+            return content.Properties.SelectMany(p => p.Values.Select(v => v.Segment)).Distinct();
+        }
+
+        private ContentVariantDisplay CreateVariantDisplay(MapperContext context, IContent content, Language language, string segment)
+        {
+            context.SetCulture(language?.IsoCode);
+            context.SetSegment(segment);
+
+            var variantDisplay = context.Map<ContentVariantDisplay>(content);
+
+            variantDisplay.Segment = segment;
+            variantDisplay.Language = language;
+            variantDisplay.Name = content.GetCultureName(language?.IsoCode);
+
+            return variantDisplay;
         }
     }
 }


remove tokengenerator dependency from authenticationservice

--- src/Wilcommerce.Auth/Services/AuthenticationService.cs
+++ src/Wilcommerce.Auth/Services/AuthenticationService.cs
@@ -23,11 +23,6 @@
         public IAuthDatabase AuthDatabase { get; }

         /// <summary>
-        /// Get the token generator service
-        /// </summary>
-        public ITokenGenerator TokenGenerator { get; }
-
-        /// <summary>
         /// Get the event bus
         /// </summary>
         public IEventBus EventBus { get; }
@@ -41,13 +36,11 @@
         /// Construct the authentication service
         /// </summary>
         /// <param name="authDatabase">The common database instance</param>
-        /// <param name="tokenGenerator">The token generator instance</param>
         /// <param name="eventBus">The event bus instance</param>
         /// <param name="signInManager"></param>
-        public AuthenticationService(IAuthDatabase authDatabase, ITokenGenerator tokenGenerator, IEventBus eventBus, SignInManager<User> signInManager)
+        public AuthenticationService(IAuthDatabase authDatabase, IEventBus eventBus, SignInManager<User> signInManager)
         {
             AuthDatabase = authDatabase ?? throw new ArgumentNullException(nameof(authDatabase));
-            TokenGenerator = tokenGenerator ?? throw new ArgumentNullException(nameof(tokenGenerator));
             EventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus));
             SignInManager = signInManager ?? throw new ArgumentNullException(nameof(signInManager));
         }


Revering SDK path back at all places

Revering SDK path back at all places

--- CreateDbgEngIdl/Program.cs
+++ CreateDbgEngIdl/Program.cs
@@ -425,7 +425,7 @@
             ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\Program Files (x86)\Windows Kits\10\bin\x64\midl.exe");
             string midlPlatform = IntPtr.Size == 4 ? "/win32 /robust" : "/x64";

-            startInfo.Arguments = @"/I""C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um"" /I""C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\shared"" output.idl /tlb output.tlb " + midlPlatform;
+            startInfo.Arguments = @"/I""C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um"" /I""C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\shared"" output.idl /tlb output.tlb " + midlPlatform;
             startInfo.UseShellExecute = false;
             startInfo.EnvironmentVariables["Path"] = @"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;" + startInfo.EnvironmentVariables["Path"];
             using (Process process = Process.Start(startInfo))


Visible renamed IsVisible

Visible renamed IsVisible

--- Crow/src/Widgets/Widget.cs
+++ Crow/src/Widgets/Widget.cs
@@ -898,16 +898,24 @@
 		/// <summary>
 		/// set the visible state of the control, invisible controls does reserve space in the layouting system.
 		/// </summary>
+		[Obsolete][DesignCategory ("Appearance")][DefaultValue(true)]
+		public virtual bool Visible {
+			get => IsVisible;
+			set => IsVisible = value;
+		}
+		/// <summary>
+		/// set the visible state of the control, invisible controls does reserve space in the layouting system.
+		/// </summary>
 		[DesignCategory ("Appearance")][DefaultValue(true)]
-		public virtual bool Visible {
-			get { return isVisible; }
+		public virtual bool IsVisible {
+			get => isVisible;
 			set {
 				if (value == isVisible)
 					return;

 				isVisible = value;

-				if (!Visible)
+				if (!isVisible)
 					unshownPostActions ();
 				RegisterForLayouting (LayoutingType.Sizing);


Добавил комментарий 2

Добавил комментарий 2

--- Parser/Parser/Form1.cs
+++ Parser/Parser/Form1.cs
@@ -159,7 +159,8 @@
             button4.Visible = false;
         }

-        private CONTRACT GetContract(Excel_Table Table, int i, Editable_Params Params, Colomn_Numbers Colomn_N)
+        // Получить список контактов
+	private CONTRACT GetContract(Excel_Table Table, int i, Editable_Params Params, Colomn_Numbers Colomn_N)
         {
             CONTRACT Con = new CONTRACT();


Fix writing of panel.png

Fix writing of panel.png

--- Pre2/AssetConverter.cs
+++ Pre2/AssetConverter.cs
@@ -49,7 +49,7 @@
             using (Stream input = new MemoryStream(SqzUnpacker.Unpack(Path.Combine(SqzDir, "ALLFONTS.SQZ"))))
             {
                 FontYearDevs = ReadTiles(input, 41, FontYearDevsInfo.W, FontYearDevsInfo.H);
-                byte[] panelImageRaw = new byte[3680];
+                byte[] panelImageRaw = new byte[PanelImageInfo.W * PanelImageInfo.H / 2];
                 input.Read(panelImageRaw, 0, panelImageRaw.Length);
                 PanelImage = ConvertIndex4ToIndex8Bytes(ConvertPlanarIndex4Bytes(panelImageRaw));
                 PanelSprites = ReadTiles(input, 17, PanelSpritesInfo.W, PanelSpritesInfo.H);
@@ -423,7 +423,7 @@
             byte[] palDefault = LevelPalettes[0];

             GenerateTileSet(FontYearDevs, palYearDevs, FontYearDevs.Length, FontYearDevsInfo.W, FontYearDevsInfo.H, CacheDir, "FontYearDevs");
-            ConvertIndex4(PanelImage, Path.Combine(CacheDir, "panel.png"), palDefault, PanelImageInfo.W, PanelImageInfo.H);
+            WritePng8(Path.Combine(CacheDir, "panel.png"), PanelImage, palDefault, PanelImageInfo.W, PanelImageInfo.H);
             GenerateTileSet(PanelSprites, palDefault, PanelSprites.Length, PanelSpritesInfo.W, PanelSpritesInfo.H, CacheDir, "PanelSprites");
             GenerateTileSet(FontUnknown, palDefault, FontUnknown.Length, FontUnknownInfo.W, FontUnknownInfo.H, CacheDir, "FontUnknown");


VHD: Improve write performance, by not replacing the footer at the end of the file until it's closed (disposed of).  This is safe because the 'footer' at the start of the file can be used, should the footer fail to be written for some reason.

--- src/Vhd/DynamicStream.cs
+++ src/Vhd/DynamicStream.cs
@@ -39,6 +39,8 @@
         private uint[] _blockAllocationTable;
         private byte[][] _blockBitmaps;
         private int _blockBitmapSize;
+        private long _nextBlockStart;
+        private bool _newBlocksAllocated;

         public DynamicStream(Stream fileStream, DynamicHeader dynamicHeader, long length, SparseStream parentStream, Ownership ownsParentStream)
         {
@@ -77,6 +79,15 @@
             {
                 if (disposing)
                 {
+                    if (_newBlocksAllocated)
+                    {
+                        // Update the footer at the end of the file (if we allocated new blocks).
+                        _fileStream.Position = 0;
+                        byte[] footerData = Utilities.ReadFully(_fileStream, Utilities.SectorSize);
+                        _fileStream.Position = _nextBlockStart;
+                        _fileStream.Write(footerData, 0, footerData.Length);
+                    }
+
                     if (_ownsParentStream == Ownership.Dispose && _parentStream != null)
                     {
                         _parentStream.Dispose();
@@ -483,10 +494,29 @@
             _fileStream.Position = _dynamicHeader.TableOffset;
             byte[] data = Utilities.ReadFully(_fileStream, _dynamicHeader.MaxTableEntries * 4);

+            uint lastBlockStartSector = 0;
+
             uint[] bat = new uint[_dynamicHeader.MaxTableEntries];
             for (int i = 0; i < _dynamicHeader.MaxTableEntries; ++i)
             {
-                bat[i] = Utilities.ToUInt32BigEndian(data, i * 4);
+                uint val = Utilities.ToUInt32BigEndian(data, i * 4);
+                if (val != uint.MaxValue && val >= lastBlockStartSector)
+                {
+                    lastBlockStartSector = val;
+                }
+
+                bat[i] = val;
+            }
+
+            if (lastBlockStartSector == 0)
+            {
+                // No blocks allocated yet, so infer it's at the end of the BAT
+                _nextBlockStart = Utilities.RoundUp(_fileStream.Position, Utilities.SectorSize);
+            }
+            else
+            {
+                // Currently at start of last block in file, move to just beyond that block
+                _nextBlockStart = (lastBlockStartSector * (long)Utilities.SectorSize) + _blockBitmapSize + _dynamicHeader.BlockSize;
             }

             _blockAllocationTable = bat;
@@ -519,18 +549,8 @@
                 throw new ArgumentException("Attempt to allocate existing block");
             }

-            long newBlockStart = _fileStream.Length - 512;
-
-            _fileStream.Position = newBlockStart;
-            byte[] footer = Utilities.ReadFully(_fileStream, Utilities.SectorSize);
-            if (Utilities.BytesToString(footer, 0, 8) != Footer.FileCookie)
-            {
-                // If the footer is invalid, assume it's just missing, so next block goes on
-                // end of file, and we need the copy from the front of the file to put on the
-                // end (after the new block)
-                newBlockStart = _fileStream.Length;
-                Utilities.ReadFully(_fileStream, footer, 0, Utilities.SectorSize);
-            }
+            _newBlocksAllocated = true;
+            long newBlockStart = _nextBlockStart;

             // Create and write new sector bitmap
             byte[] bitmap = new byte[_blockBitmapSize];
@@ -538,9 +558,11 @@
             _fileStream.Write(bitmap, 0, _blockBitmapSize);
             _blockBitmaps[block] = bitmap;

-            // Write the new footer
-            _fileStream.Position = newBlockStart + _blockBitmapSize + _dynamicHeader.BlockSize;
-            _fileStream.Write(footer, 0, footer.Length);
+            _nextBlockStart += _blockBitmapSize + _dynamicHeader.BlockSize;
+            if (_fileStream.Length < _nextBlockStart)
+            {
+                _fileStream.SetLength(_nextBlockStart);
+            }

             // Update the BAT entry for the new block
             byte[] entryBuffer = new byte[4];
@@ -552,7 +574,6 @@

         private void WriteBlockBitmap(long block)
         {
-            // Read in bitmap
             _fileStream.Position = ((long)_blockAllocationTable[block]) * Utilities.SectorSize;
             _fileStream.Write(_blockBitmaps[block], 0, _blockBitmapSize);
         }


enforce constraints, even if it's kinda funny for now

--- src/Widgets/ImageView.cs
+++ src/Widgets/ImageView.cs
@@ -148,7 +148,7 @@
 				if (Selection == Rectangle.Zero)
 					return;

-				ConstrainSelection ();
+				Selection = ConstrainSelection (Selection, false, false);
 			}
 		}

@@ -953,10 +953,20 @@
 				    Math.Abs (evnt.Y - win_anchor.Y) < SELECTION_THRESHOLD)
 					return true;

-				Selection = new Rectangle (fixed_width ? Selection.X : Math.Min (selection_anchor.X, img.X),
-							   fixed_height ? Selection.Y : Math.Min (selection_anchor.Y, img.Y),
-							   fixed_width ? Selection.Width : Math.Abs (selection_anchor.X - img.X),
-							   fixed_height ? Selection.Height : Math.Abs (selection_anchor.Y - img.Y));
+
+				if (selection_xy_ratio == 0)
+					Selection = new Rectangle (fixed_width ? Selection.X : Math.Min (selection_anchor.X, img.X),
+								   fixed_height ? Selection.Y : Math.Min (selection_anchor.Y, img.Y),
+								   fixed_width ? Selection.Width : Math.Abs (selection_anchor.X - img.X),
+								   fixed_height ? Selection.Height : Math.Abs (selection_anchor.Y - img.Y));
+
+				else
+					Selection = ConstrainSelection (new Rectangle (Math.Min (selection_anchor.X, img.X),
+										       Math.Min (selection_anchor.Y, img.Y),
+										       Math.Abs (selection_anchor.X - img.X),
+										       Math.Abs (selection_anchor.Y - img.Y)),
+									fixed_width, fixed_height);
+
 				return true;
 			}

@@ -972,33 +982,34 @@
 			return true;
 		}

-		void ConstrainSelection ()
+		Rectangle ConstrainSelection (Rectangle sel, bool fixed_width, bool fixed_height)
 		{
 			double constrain = selection_xy_ratio;
-			if ((double)Selection.Width > (double)Selection.Height && selection_xy_ratio < 1 ||
-			    (double)Selection.Width < (double)Selection.Height && selection_xy_ratio > 1)
+			if ((double)sel.Width > (double)sel.Height && selection_xy_ratio < 1 ||
+			    (double)sel.Width < (double)sel.Height && selection_xy_ratio > 1)
 				constrain = 1.0 / constrain;

-			double ratio = (double)Selection.Width / (double)Selection.Height;
-			int height = Selection.Height;
-			int width = Selection.Width;
+
+			double ratio = (double)sel.Width / (double)sel.Height;
+			int height = sel.Height;
+			int width = sel.Width;
 			if (ratio > constrain) {
-				height = (int)((double)Selection.Width / constrain);
+				height = (int)((double)sel.Width / constrain);
 				if (height > Pixbuf.Height) {
-					height = Selection.Height;
+					height = sel.Height;
 					width = (int)(height * constrain);
 				}
 			} else {
 				width = (int)(height * constrain);
 				if (width > Pixbuf.Width) {
-					width = Selection.Width;
+					width = sel.Width;
 					height = (int)((double)width / constrain);
 				}
 			}

-			Selection = new Rectangle (Selection.X + Selection.Width < Pixbuf.Width ? Selection.X : Pixbuf.Width - Selection.Width,
-						   Selection.Y + Selection.Height < Pixbuf.Height ? Selection.Y : Pixbuf.Height - Selection.Height,
-						   width, height);
+			return new Rectangle (sel.X + width < Pixbuf.Width ? sel.X : Pixbuf.Width - width,
+					      sel.Y + height < Pixbuf.Height ? sel.Y : Pixbuf.Height - height,
+					      width, height);
 		}
 #endregion
 	}


Change upscale to a property such that it shouldn't be passed to ZoomFit.

It's a value that's dependent on the image loaded, not on how we
ZoomFit.

--- src/Widgets/ImageView.cs
+++ src/Widgets/ImageView.cs
@@ -53,6 +53,7 @@

 			Pixbuf = pixbuf;
 			PixbufOrientation = orientation;
+			Upscale = upscale;

 			ComputeMinZoom ();
 			ComputeScaledSize ();
@@ -62,7 +63,7 @@
 				Hadjustment.Value = Vadjustment.Value = 0;
 				XOffset = YOffset = 0;
 				AdjustmentsChanged += ScrollToAdjustments;
-				ZoomFit (upscale);
+				ZoomFit ();
 			} else {
 				// TODO: Recalculate the adjustments and offsets such that the
 				// view on the image is maintained.
@@ -204,7 +205,7 @@
 			get { return fit; }
 		}

-		void ZoomFit (bool upscale)
+		public void ZoomFit ()
 		{
 			Gtk.ScrolledWindow scrolled = Parent as Gtk.ScrolledWindow;
 			if (scrolled != null)
@@ -212,8 +213,6 @@

 			ComputeMinZoom ();

-			this.upscale = upscale;
-
 			fit = true;
 			DoZoom (MIN_ZOOM, false, 0, 0);

@@ -275,11 +274,8 @@
 			get { return min_zoom; }
 		}

-		bool upscale;
-		protected void ZoomFit ()
-		{
-			ZoomFit (upscale);
-		}
+
+		bool Upscale { get; set; }

 		protected virtual void ApplyColorTransform (Pixbuf pixbuf)
 		{
@@ -438,7 +434,7 @@
 			base.OnSizeAllocated (allocation);

 			if (fit)
-				ZoomFit (upscale);
+				ZoomFit ();
 		}

 		protected override bool OnExposeEvent (Gdk.EventExpose evnt)
@@ -853,7 +849,7 @@
 				height = Pixbuf.Width;
 			}

-			if (upscale)
+			if (Upscale)
 				min_zoom = Math.Min ((double)Allocation.Width / width,
 									 (double)Allocation.Height / height);
 			else


タイムカードの退勤時刻連携チェックボックスの有効・無効の制御が上手く行っていなかったバグを修正

--- AipoReminder/Form/Form1.cs
+++ AipoReminder/Form/Form1.cs
@@ -290,16 +290,6 @@
                 // Aipoのバージョン依存項目の設定
                 InitAipoVersionConfig();

-                // タイムカード連携に合わせて退勤時刻連携も連動させる
-                if (SettingManager.CheckExtTimeCard)
-                {
-                    checkBoxExtTimeCardUpdateCkeckout.Enabled = true;
-                }
-                else
-                {
-                    checkBoxExtTimeCardUpdateCkeckout.Enabled = false;
-                }
-
                 // 設定を保存
                 SettingManager.WhatsnewInfoSave();

@@ -977,6 +967,15 @@
             {
                 checkBoxExtTimeCard.Enabled = false;
             }
+            // タイムカード連携に合わせて退勤時刻連携も連動させる
+            if (SettingManager.CheckExtTimeCard)
+            {
+                checkBoxExtTimeCardUpdateCkeckout.Enabled = true;
+            }
+            else
+            {
+                checkBoxExtTimeCardUpdateCkeckout.Enabled = false;
+            }

             // Aipoのバージョンが6以上の場合は新着情報のチェックボックスを非活性にする
             if (6 <= selectedAipoVersion)


Fix loader error message when algorithm not found

When the algorithm type in config.json was not found, Loader.cs
would throw a confusing error message. Modified the error message
to make it clearer.

Previous error message: "Unable to resolve multiple algorithm types
to a single type...". New error message: "Algorithm type name not
found,or unable to resolve multiple algorithm types to a single type...".

--- AlgorithmFactory/Loader.cs
+++ AlgorithmFactory/Loader.cs
@@ -262,7 +262,7 @@

                     if (string.IsNullOrEmpty(types[0]))
                     {
-                        errorMessage = "Unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.";
+                        errorMessage = "Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.";
                         Log.Error($"Loader.TryCreateILAlgorithm(): {errorMessage}");
                         return false;
                     }
@@ -284,7 +284,7 @@
             }
             catch (Exception err)
             {
-                errorMessage = "Unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm. ";
+                errorMessage = "Algorithm type name not found, or unable to resolve multiple algorithm types to a single type. Please verify algorithm type name matches the algorithm name in the configuration file and that there is one and only one class derived from QCAlgorithm.";
                 errorMessage += err.InnerException == null ? err.Message : err.InnerException.Message;
                 Log.Error($"Loader.TryCreateILAlgorithm(): {errorMessage}");
                 return false;


Removing duplication in logic branches

Removing duplication in logic branches

--- AgileMapper/ObjectPopulation/DerivedComplexTypeMappingsFactory.cs
+++ AgileMapper/ObjectPopulation/DerivedComplexTypeMappingsFactory.cs
@@ -152,7 +152,7 @@

                 var derivedTargetType = derivedTypePairs[0].DerivedTargetType;

-                if (derivedTypePairs.All(tp => !tp.HasConfiguredCondition))
+                if (derivedTypePairs.None(tp => tp.HasConfiguredCondition))
                 {
                     typePairsCondition = GetTargetValidCheckOrNull(derivedTargetType, declaredTypeMapperData);

@@ -168,21 +168,11 @@
                             .Conditional(derivedSourceType, ifSourceVariableIsDerivedTypeThenMap));
                         continue;
                     }
-
-                    ifSourceVariableIsDerivedTypeThenMap = GetMapFromConditionOrDefaultExpression(
-                        declaredTypeMappingData,
-                        condition,
-                        typePairsCondition,
-                        typedVariable,
-                        targetType,
-                        derivedTargetType);
-
-                    derivedTypeMappings.Add(DerivedTypeMapping
-                        .Conditional(derivedSourceType, ifSourceVariableIsDerivedTypeThenMap));
-                    continue;
                 }
-
-                typePairsCondition = GetTypePairsCondition(derivedTypePairs, declaredTypeMapperData);
+                else
+                {
+                    typePairsCondition = GetTypePairsCondition(derivedTypePairs, declaredTypeMapperData);
+                }

                 ifSourceVariableIsDerivedTypeThenMap = GetMapFromConditionOrDefaultExpression(
                     declaredTypeMappingData,


Allow setting UpdateAssemblyInfo from GitVersionAttribute

--- source/Nuke.Common/Tools/GitVersion/GitVersionAttribute.cs
+++ source/Nuke.Common/Tools/GitVersion/GitVersionAttribute.cs
@@ -19,6 +19,7 @@
     public class GitVersionAttribute : InjectionAttributeBase
     {
         public bool DisableOnUnix { get; set; }
+        public bool UpdateAssemblyInfo { get; set; }

         public override object GetValue(MemberInfo member, object instance)
         {
@@ -31,7 +32,8 @@

             return ControlFlow.SuppressErrors(() =>
                     GitVersionTasks.GitVersion(s => s
-                            .DisableLogOutput())
+                            .DisableLogOutput()
+                            .SetUpdateAssemblyInfo(UpdateAssemblyInfo))
                         .Result,
                 includeStackTrace: true);
         }


Fix deploy message (#150)

Fix deploy message (#150)

- the line outputting the assembly description was wrongly formated

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- source/VisualStudio.Extension/Deployment/DeployProvider.cs
+++ source/VisualStudio.Extension/Deployment/DeployProvider.cs
@@ -179,7 +179,7 @@
                     using (FileStream fs = File.Open(peItem.path, FileMode.Open, FileAccess.Read))
                     {
                         long length = (fs.Length + 3) / 4 * 4;
-                        await outputPaneWriter.WriteLineAsync($"Adding {Path.GetFileNameWithoutExtension(peItem.path)} v{peItem.version}) ({length.ToString()} bytes) to deployment bundle");
+                        await outputPaneWriter.WriteLineAsync($"Adding [{Path.GetFileNameWithoutExtension(peItem.path)} v{peItem.version}] ({length.ToString()} bytes) to deployment bundle");
                         byte[] buffer = new byte[length];

                         fs.Read(buffer, 0, (int)fs.Length);


Ctrl + H adds or removes highlights; refactoring.

--- GhostWriter/MainForm.cs
+++ GhostWriter/MainForm.cs
@@ -33,6 +33,8 @@

         private bool _swapFlag;

+        private volatile bool _running;
+
         public MainForm()
         {
             InitializeComponent();
@@ -503,7 +505,10 @@

             if (e.Modifiers == Keys.Control && e.KeyCode == Keys.H)
             {
-                textBox.SelectionBackColor = Color.Yellow;
+                textBox.SelectionBackColor =
+                    textBox.SelectionBackColor == Color.White
+                        ? Color.Yellow
+                        : Color.White;
             }
         }

@@ -730,13 +735,12 @@
         {
             var appData = new AppData
             {
-                RecentFiles = new List<string>()
+                RecentFiles = new List<string>(),
+                SetInitialCodeOnLoad = setInitialCodeOnLoadToolStripMenuItem.Checked,
+                PresentationMode = presentationModeToolStripMenuItem.Checked,
+                MonitorApplication = monitorApplicationToolStripMenuItem.Checked,
+                NoSound = noSoundToolStripMenuItem.Checked
             };
-
-            appData.SetInitialCodeOnLoad = setInitialCodeOnLoadToolStripMenuItem.Checked;
-            appData.PresentationMode = presentationModeToolStripMenuItem.Checked;
-            appData.MonitorApplication = monitorApplicationToolStripMenuItem.Checked;
-            appData.NoSound = noSoundToolStripMenuItem.Checked;

             if (normalToolStripMenuItem.Checked)
             {
@@ -896,8 +900,6 @@
             SaveAppData();
         }

-        private volatile bool _running;
-
         private void SetPictureBoxImage()
         {
             if (monitorApplicationToolStripMenuItem.Checked


fixed some comment typos

fixed some comment typos

--- Hacon.Motash/Checker.cs
+++ Hacon.Motash/Checker.cs
@@ -17,11 +17,11 @@
         #region Properties and members
         // store tasks problems in the string
         private StringBuilder _report = new StringBuilder();
-        // cound our problems
+        // count our problems
         int _problems = 0;

         /// <summary>
-        /// Use this instead of a hardcoded string
+        /// Use this instead of a hard-coded string
         /// </summary>
         public string AppName
         {
@@ -98,7 +98,7 @@
         }

         /// <summary>
-        /// The email entry, may be configerable in the future.
+        /// The email entry, may be configurable in the future.
         /// </summary>
         public string EmailIntro
         {


Bugfixes

Bugfixes

--- Hermod/DNS/DNSClient.cs
+++ Hermod/DNS/DNSClient.cs
@@ -173,8 +173,8 @@
         /// <param name="SearchForIPv4DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv4 network configuration.</param>
         /// <param name="SearchForIPv6DNSServers">If yes, the DNS client will query a list of DNS servers from the IPv6 network configuration.</param>
         public DNSClient(IEnumerable<IPSocket>  ManualDNSServers,
-                         Boolean                SearchForIPv4DNSServers = true,
-                         Boolean                SearchForIPv6DNSServers = true)
+                         Boolean                SearchForIPv4DNSServers = false,
+                         Boolean                SearchForIPv6DNSServers = false)

         {


Change programming resources Name label to Repository Name.

--- src/CompetitionPlatform/Views/Project/CreateProject.cshtml
+++ src/CompetitionPlatform/Views/Project/CreateProject.cshtml
@@ -152,7 +152,7 @@

-                            Name
+                            Repository Name
                             <input class="form-control" type="text" name="ResourcesList[0].Name"/>

@@ -167,7 +167,7 @@

-                            Name
+                            Repository Name
                             <input class="form-control" type="text" name="ResourcesList[1].Name" />

@@ -182,7 +182,7 @@

-                            Name
+                            Repository Name
                             <input class="form-control" type="text" name="ResourcesList[2].Name" />


Update docs for WithAttributes, still talks about inner TagBuilder which we don't have anymore. The TagBuilder only gets created on demand anymore when having to write anything.

--- HtmlBuilders/HtmlTag.cs
+++ HtmlBuilders/HtmlTag.cs
@@ -54,7 +54,7 @@
     }

     /// <summary>
-    ///   Creates a new HtmlTag replacing the inner TagBuilder
+    ///   Creates a new HtmlTag replacing the inner attributes
     /// </summary>
     public HtmlTag WithAttributes(IImmutableDictionary<string, string> attributes) {
       return new HtmlTag(_tagName, attributes, _contents, _tagRenderMode);


Replace new GridSize(int x, int y) calls with just the positions using just the x, y coordinates of the Tile.

--- cocos2d/actions/action_tiled_grid/CCShakyTiles3D.cs
+++ cocos2d/actions/action_tiled_grid/CCShakyTiles3D.cs
@@ -84,7 +84,7 @@
             {
                 for (j = 0; j < m_sGridSize.Y; ++j)
                 {
-                    CCQuad3 coords = OriginalTile(new CCGridSize(i, j));
+                    CCQuad3 coords = OriginalTile(i, j);
                     // X
                     coords.BottomLeft.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange;
                     coords.BottomRight.X += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange;
@@ -105,7 +105,7 @@
                         coords.TopRight.Z += (CCRandom.Next() % (m_nRandrange * 2)) - m_nRandrange;
                     }

-                    SetTile(new CCGridSize(i, j), ref coords);
+                    SetTile(i, j, ref coords);
                 }
             }
         }


maker faire

maker faire

--- com.opentrigger.distributor/cli/DistributorEntry.cs
+++ com.opentrigger.distributor/cli/DistributorEntry.cs
@@ -59,7 +59,7 @@
                         ReleaseTopic = null,
                         TriggerTopic = "/opentrigger/signals/sensors",
                         Distance = 0,
-                        //IncludedMacs = includeMacs_TokenCube,
+                        IncludedMacs = includeMacs_TokenCube,
                         ExcludedMacs = excludeMacs,
                     },
                 },


strg+c support

strg+c support

--- com.opentrigger.distributor/cli/DistributorEntry.cs
+++ com.opentrigger.distributor/cli/DistributorEntry.cs
@@ -10,6 +10,7 @@
 {
     class DistributorEntry
     {
+        private static bool keepRunning = true;
         static void Main(string[] args)
         {
             // 0 = Quiet
@@ -57,19 +58,29 @@

             config.Verbosity += verbosity;

+            Console.CancelKeyPress += (sender, eventArgs) =>
+            {
+                if(!eventArgs.Cancel) return;
+                eventArgs.Cancel = false;
+                keepRunning = false;
+                if (config.Verbosity > 0) Console.WriteLine("Ctrl+C");
+            };
+
             if(config.Verbosity > 0) Console.WriteLine(config.Serialize());

             var distributors = config.QueueDistributorConfigs.Select(queueDistributorConfig => new QueueDistributor(queueDistributorConfig,config.Verbosity)).ToList();
-            if (config.RunParallel) while (true)
+            if (config.RunParallel) while (keepRunning)
             {
                 Parallel.ForEach(distributors, d => d.Distribute());
                 Thread.Sleep(config.IdleCycle);
             }
-            else while (true)
+            else while (keepRunning)
             {
                 distributors.ForEach(d=>d.Distribute());
                 Thread.Sleep(config.IdleCycle);
             }
+
+            if (config.Verbosity > 0) Console.WriteLine("normal shutdown");
         }
     }
 }


fix: use Integer(int, int) at Integer(Range)

--- Raccoon/Util/Random.cs
+++ Raccoon/Util/Random.cs
@@ -123,7 +123,7 @@
         /// <param name="min">Values range.</param>
         /// <returns>Number in range.</returns>
         public static int Integer(Range range) {
-            return BaseRandom.Next((int) range.Min, ((int) range.Max) + 1);
+            return Integer((int) range.Min, (int) range.Max);
         }

         /// <summary>


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "16.0.0";
-				ClientTag = "dotnet:20-04-24";
+				ClientTag = "dotnet:20-04-25";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "16.14.0";
-				ClientTag = "dotnet:21-01-07";
+				ClientTag = "dotnet:21-01-08";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "18.11.0";
-				ClientTag = "dotnet:22-07-28";
+				ClientTag = "dotnet:22-07-29";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.19.0";
-				ClientTag = "dotnet:20-03-22";
+				ClientTag = "dotnet:20-03-23";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.14.0";
-				ClientTag = "dotnet:19-12-25";
+				ClientTag = "dotnet:19-12-26";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "14.3.0";
-				ClientTag = "dotnet:18-07-27";
+				ClientTag = "dotnet:18-07-28";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "17.2.0";
-				ClientTag = "dotnet:21-05-28";
+				ClientTag = "dotnet:21-05-29";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "15.17.0";
-				ClientTag = "dotnet:20-02-23";
+				ClientTag = "dotnet:20-02-24";
 		}

 		#region Properties


New clientlib ver

New clientlib ver

--- KalturaClient/Client.cs
+++ KalturaClient/Client.cs
@@ -36,7 +36,7 @@
 		public Client(Configuration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:17-03-25";
+				ClientTag = "dotnet:17-03-26";
 		}

 		#region Properties


moving laurette to generate code in Standard Assets; this improves compile times slightly (see http://forum.unity3d.com/threads/standard-assets-no-longer-reducing-compile-time.416956/ )

--- LauretteBuildProcess.cs
+++ LauretteBuildProcess.cs
@@ -31,7 +31,7 @@

 	static LauretteBuildProcess() {
 		// Check if the output file exists, if not we should probably try generating it!
-		if (File.Exists (OutputDirectory + "/Localizations.cs") == false) {
+		if (File.Exists (OutputDirectory + "/Standard Assets/Localizations.cs") == false) {
 			ProcessStringsFiles ();
 		}
 	}
@@ -41,7 +41,7 @@
 		bool stringsFileWasChanged = false;

 		// Check if the output file exists, if not we should probably try generating it!
-		if (File.Exists (OutputDirectory + "/Localizations.cs") == false) {
+		if (File.Exists (OutputDirectory + "/Standard Assets/Localizations.cs") == false) {
 			stringsFileWasChanged = true;
 		}

@@ -80,8 +80,12 @@
 			}
 		}

+		if (Directory.Exists (OutputDirectory + "/Standard Assets/") == false) {
+			Directory.CreateDirectory (OutputDirectory + "/Standard Assets/");
+		}
+
 		string error = null;
-		laurette.Process (allStringsFiles.ToArray(), OutputDirectory+"/Localizations.cs", out error);
+		laurette.Process (allStringsFiles.ToArray(), OutputDirectory+"/Standard Assets/Localizations.cs", out error);

 		AssetDatabase.Refresh ();


Changed generator to use CheckMacroPass.

--- tests/Basic/Basic.cs
+++ tests/Basic/Basic.cs
@@ -27,16 +27,9 @@
         public override void Preprocess(Driver driver, ASTContext ctx)
         {
             driver.AddTranslationUnitPass(new GetterSetterToPropertyPass());
+            driver.AddTranslationUnitPass(new CheckMacroPass());
             ctx.SetClassAsValueType("Bar");
             ctx.SetClassAsValueType("Bar2");
-            ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOut", 1, ParameterUsage.Out);
-            ctx.SetMethodParameterUsage("Hello", "TestPrimitiveOutRef", 1, ParameterUsage.Out);
-            ctx.SetMethodParameterUsage("Hello", "TestPrimitiveInOut", 1, ParameterUsage.InOut);
-            ctx.SetMethodParameterUsage("Hello", "TestPrimitiveInOutRef", 1, ParameterUsage.InOut);
-            ctx.SetMethodParameterUsage("Hello", "EnumOut", 2, ParameterUsage.Out);
-            ctx.SetMethodParameterUsage("Hello", "EnumOutRef", 2, ParameterUsage.Out);
-            ctx.SetMethodParameterUsage("Hello", "EnumInOut", 1, ParameterUsage.InOut);
-            ctx.SetMethodParameterUsage("Hello", "EnumInOutRef", 1, ParameterUsage.InOut);
         }

         public static void Main(string[] args)


Check if parameter type is a RequestBody, if so then do not require that the name property be filled out.

--- RestSharp/Parameter.cs
+++ RestSharp/Parameter.cs
@@ -27,7 +27,8 @@
     {
         public Parameter(string name, object value, ParameterType type)
         {
-            Ensure.NotEmpty(name, nameof(name));
+            if (type != ParameterType.RequestBody)
+              Ensure.NotEmpty(name, nameof(name));

             Name = name;
             Value = value;