handler tests refactoring

handler tests refactoring

--- test/RestDotNet.Tests/HandlerTests.cs
+++ test/RestDotNet.Tests/HandlerTests.cs
@@ -1,97 +1,109 @@
 using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
 using System.Net;
 using System.Net.Http;
 using System.Threading.Tasks;
+using RestDotNet.Converters;
 using Xunit;

 namespace RestDotNet.Tests
 {
     public class HandlerTests : BaseTest
     {
-        private readonly Uri _uri;
-        private readonly string _path;
+        private readonly RestJsonConverter _jsonConverter;

         public HandlerTests()
         {
-            _uri = new Uri("http://test/");
-            _path = string.Empty;
+            _jsonConverter = new RestJsonConverter();
         }

-        [Fact]
-        public async Task Execute_Success()
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public Task Throws_UnhandledResponseException_If_Not_Handled(HttpStatusCode code)
         {
-            int expected = 1;
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.OK, expected);
-            var client = new RestClient(_uri, handler);
-            IRestHandler<int> restHandler = client.Put<int>(_path, new { });
-
-            int act = await restHandler.ExecuteAsync();
-
+            IRestHandler handler = new RestHandler<object>(
+                token => Task.FromResult(new HttpResponseMessage(code)),
+                _jsonConverter);
+
+            return Assert.ThrowsAsync<UnhandledResponseException>(() => handler.HandleAsync());
+        }
+
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public Task Does_Not_Throws_UnhandledResponseException_If_Handled(HttpStatusCode code)
+        {
+            IRestHandler handler = new RestHandler<object>(
+                token => Task.FromResult(new HttpResponseMessage(code)),
+                _jsonConverter);
+            handler.RegisterCallback(code, () => {});
+
+            return handler.HandleAsync();
+        }
+
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public async Task Invoke_Typed_Callback_With_Content(HttpStatusCode code)
+        {
+            int[] expected = {1, 2, 3};
+            IList<int> act = default(IList<int>);
+            IRestHandler handler = new RestHandler<string>(
+                token => Task.FromResult(new HttpResponseMessage(code){ Content = new StringContent(_jsonConverter.Serialize(expected)) }),
+                _jsonConverter);
+            handler.RegisterCallback(code, (IList<int> list) => act = list);
+
+            await handler.HandleAsync();
             Assert.Equal(expected, act);
         }

-        [Fact]
-        public async Task Execute_UnhandledResponseException()
-        {
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.BadRequest, 1);
-            var client = new RestClient(_uri, handler);
-            IRestHandler<int> restHandler = client.Put<int>(_path, new { });
-
-            await Assert.ThrowsAsync<UnhandledResponseException>(async () => await restHandler.ExecuteAsync());
-        }
-
-        [Fact]
-        public async Task Fluent_Success()
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public async Task Invoke_Untyped_Callback_With_Content(HttpStatusCode code)
         {
             int expected = 1;
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.OK, expected);
-            var client = new RestClient(_uri, handler);
-            IRestHandler<int> restHandler = client.Put<int>(_path, new { });
-
-            int act = 0;
-            await restHandler.SuccessAsync(result => act = result);
-
+            int act = default(int);
+            IRestHandler handler = new RestHandler<string>(
+                token => Task.FromResult(new HttpResponseMessage(code) { Content = new StringContent(_jsonConverter.Serialize(expected)) }),
+                _jsonConverter);
+            handler.RegisterCallback(code, () => act = expected);
+
+            await handler.HandleAsync();
             Assert.Equal(expected, act);
         }

-        [Fact]
-        public async Task Fluent_BadRequest()
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public Task Invoke_Typed_Callback_Without_Content_Throw_DeserializationException(HttpStatusCode code)
+        {
+            IRestHandler handler = new RestHandler<string>(
+                token => Task.FromResult(new HttpResponseMessage(code)),
+                _jsonConverter);
+            handler.RegisterCallback(code, (IList<int> list) => {});
+
+            return Assert.ThrowsAsync<DeserializationException>(() => handler.HandleAsync());
+        }
+
+        [Theory]
+        [MemberData(nameof(GetStatusCodes))]
+        public async Task Invoke_Untyped_Callback_Without_Content(HttpStatusCode code)
         {
             int expected = 1;
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.BadRequest, expected);
-            var client = new RestClient(_uri, handler);
-            IRestHandler restHandler = client.Put(_path, new { });
-
-            int act = 0;
-            restHandler.BadRequest<int>(result => act = result);
-            await restHandler.SuccessAsync(() => { });
-
+            int act = default(int);
+            IRestHandler handler = new RestHandler<string>(
+                token => Task.FromResult(new HttpResponseMessage(code)),
+                _jsonConverter);
+            handler.RegisterCallback(code, () => act = expected);
+
+            await handler.HandleAsync();
             Assert.Equal(expected, act);
         }

-        [Fact]
-        public async Task Fluent_NotSuccess()
+        private static IEnumerable<object[]> GetStatusCodes()
         {
-            int expected = 1;
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.BadRequest, expected);
-            var client = new RestClient(_uri, handler);
-            IRestHandler restHandler = client.Put(_path, new { });
-
-            int act = 0;
-            restHandler.BadRequest<int>(result => act = result);
-            await restHandler.SuccessAsync(() => act = 2);
-
-            Assert.Equal(expected, act);
-        }
-
-        [Fact]
-        public async Task Fluent_UnhandledResponseException()
-        {
-            HttpMessageHandler handler = CreateHandler(HttpStatusCode.BadRequest, 1);
-            var client = new RestClient(_uri, handler);
-            IRestHandler restHandler = client.Put(_path, new { });
-
-            await Assert.ThrowsAsync<UnhandledResponseException>(async () => await restHandler.SuccessAsync(() => { }));
+            return Enum.GetValues(typeof(HttpStatusCode))
+                .Cast<HttpStatusCode>()
+                .Select(code => new object[] { code });
         }
     }
 }


ProcessTagsForSaving

ProcessTagsForSaving

--- src/PhantomNet.Core/TagProcessor.cs
+++ src/PhantomNet.Core/TagProcessor.cs
@@ -8,7 +8,7 @@
     {
         public string ProcessTagsForSaving(IEnumerable<string> tags)
         {
-            return tags == null || tags.Select(x => x.Trim()).Count() == 0 ? null : $"\n{string.Join("\n", tags.Select(x => x.Trim()))}\n";
+            return tags == null || tags.Select(x => x).Count() == 0 ? null : $"\n{string.Join("\n", tags.Select(x => x))}\n";
         }

         public IEnumerable<string> ProcessTagsForEditting(string tags)


Throw BadImageFormatException for zero-byte files (#3708)

There was a case missed in ac2d03c that caused the S.R.M error to be
worse than the equivalent full-framework error: when
`PEReader.HasMetadata` itself throws because the file is _really_ not
a PE file (for example, it has no content at all).

Related to #3560.

--- src/Shared/AssemblyNameExtension.cs
+++ src/Shared/AssemblyNameExtension.cs
@@ -204,13 +204,23 @@
             using (var stream = File.OpenRead(path))
             using (var peFile = new PEReader(stream))
             {
-                // If the file does not contain PE metadata, throw BadImageFormatException to preserve
-                // behavior from AssemblyName.GetAssemblyName(). RAR will deal with this correctly.
-                if (!peFile.HasMetadata)
+                bool hasMetadata = false;
+                try
                 {
-                    throw new BadImageFormatException(string.Format(CultureInfo.CurrentCulture,
-                        AssemblyResources.GetString("ResolveAssemblyReference.AssemblyDoesNotContainPEMetadata"),
-                        path));
+                    // This can throw if the stream is too small, which means
+                    // the assembly doesn't have metadata.
+                    hasMetadata = peFile.HasMetadata;
+                }
+                finally
+                {
+                    // If the file does not contain PE metadata, throw BadImageFormatException to preserve
+                    // behavior from AssemblyName.GetAssemblyName(). RAR will deal with this correctly.
+                    if (!hasMetadata)
+                    {
+                        throw new BadImageFormatException(string.Format(CultureInfo.CurrentCulture,
+                            AssemblyResources.GetString("ResolveAssemblyReference.AssemblyDoesNotContainPEMetadata"),
+                            path));
+                    }
                 }

                 var metadataReader = peFile.GetMetadataReader();


one off context wasn't marked as IDisposable

--- src/Marten.Testing/Harness/OneOffConfigurationsContext.cs
+++ src/Marten.Testing/Harness/OneOffConfigurationsContext.cs
@@ -11,7 +11,7 @@
     /// Use this if the tests in a fixture are going to use
     /// all custom StoreOptions configuration
     /// </summary>
-    public abstract class OneOffConfigurationsContext
+    public abstract class OneOffConfigurationsContext : IDisposable
     {
         private readonly string _schemaName;
         private DocumentStore _store;


some minor refactoring and code tidying up

--- src/Shimmer.Client/UpdateManager.cs
+++ src/Shimmer.Client/UpdateManager.cs
@@ -2,8 +2,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Diagnostics.Contracts;
-using System.Globalization;
-using System.IO;
 using System.IO.Abstractions;
 using System.Linq;
 using System.Reactive;
@@ -80,7 +78,7 @@

         IObservable<UpdateInfo> checkForUpdate(bool ignoreDeltaUpdates = false, IObserver<int> progress = null)
         {
-            IEnumerable<ReleaseEntry> localReleases = Enumerable.Empty<ReleaseEntry>();
+            var localReleases = Enumerable.Empty<ReleaseEntry>();
             progress = progress ?? new Subject<int>();

             try {
@@ -226,7 +224,7 @@
                         .Where(x => x.Name.StartsWith("app-", StringComparison.InvariantCultureIgnoreCase));
         }

-        DirectoryInfoBase[] getOldReleases(Version version)
+        IEnumerable<DirectoryInfoBase> getOldReleases(Version version)
         {
             return getReleases()
                     .Where(x => x.Name.ToVersion() < version)
@@ -370,7 +368,7 @@
             return Observable.Return(UpdateInfo.Create(findCurrentVersion(localReleases), remoteReleases, PackageDirectory, appFrameworkVersion));
         }

-        ReleaseEntry findCurrentVersion(IEnumerable<ReleaseEntry> localReleases)
+        static ReleaseEntry findCurrentVersion(IEnumerable<ReleaseEntry> localReleases)
         {
             if (!localReleases.Any()) {
                 return null;
@@ -426,7 +424,6 @@
             }
         }

-
         //
         // ApplyReleases methods
         //
@@ -595,9 +592,10 @@
                 return;
             }

+            var newCurrentFolder = "app-" + newCurrentVersion;
             var oldAppDirectories = fileSystem.GetDirectoryInfo(rootAppDirectory).GetDirectories()
                 .Where(x => x.Name.StartsWith("app-", StringComparison.InvariantCultureIgnoreCase))
-                .Where(x => x.Name != "app-" + newCurrentVersion)
+                .Where(x => x.Name != newCurrentFolder)
                 .Select(x => x.FullName)
                 .ToArray();

@@ -606,7 +604,7 @@
                 return;
             }

-            var newAppPath = Path.Combine(rootAppDirectory, "app-" + newCurrentVersion);
+            var newAppPath = Path.Combine(rootAppDirectory, newCurrentFolder);

             var taskbarPath = Path.Combine(
                 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
@@ -630,7 +628,7 @@

             foreach (var shortcut in shellLinks) {
                 try {
-                    UpdateLink(shortcut, oldAppDirectories, newAppPath);
+                    updateLink(shortcut, oldAppDirectories, newAppPath);
                 } catch (Exception ex) {
                     var message = String.Format("fixPinnedExecutables: shortcut failed: {0}", shortcut.Target);
                     log.ErrorException(message, ex);
@@ -638,7 +636,7 @@
             }
         }

-        void UpdateLink(ShellLink shortcut, string[] oldAppDirectories, string newAppPath)
+        void updateLink(ShellLink shortcut, string[] oldAppDirectories, string newAppPath)
         {
             log.Info("Processing shortcut '{0}'", shortcut.Target);
             foreach (var oldAppDirectory in oldAppDirectories) {


Adding passing test

Adding passing test

--- src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs
+++ src/NAppUpdate.Tests/FeedReaders/NauXmlFeedReaderTests.cs
@@ -88,5 +88,40 @@
 			Assert.AreEqual("below", cnd.ComparisonType);
 			Assert.AreEqual("1.0.176.0", cnd.Version);
 		}
+
+		[TestMethod]
+		public void NauReaderCanReadFeed3()
+		{
+			const string NauUpdateFeed =
+				@"<?xml version=""1.0"" encoding=""utf-8""?>
+<Feed>
+  <Title>My application</Title>
+  <Link>http://myapp.com/</Link>
+  <Tasks>
+    <FileUpdateTask localPath=""test.dll"" updateTo=""remoteFile.dll"" hotswap=""true"">
+      <Description>update details</Description>
+      <Conditions>
+        <OSCondition bit=""64"" />
+      </Conditions>
+    </FileUpdateTask>
+  </Tasks>
+</Feed>";
+
+			var reader = new NAppUpdate.Framework.FeedReaders.NauXmlFeedReader();
+			IList<IUpdateTask> updates = reader.Read(NauUpdateFeed);
+
+			Assert.IsTrue(updates.Count == 1);
+
+			var task = updates[0] as FileUpdateTask;
+			Assert.IsNotNull(task);
+			Assert.IsTrue(task.CanHotSwap);
+
+			Assert.AreEqual(1, task.UpdateConditions.ChildConditionsCount);
+
+			var cnd = task.UpdateConditions.Degrade() as OSCondition;
+			Assert.IsNotNull(cnd);
+
+			Assert.AreEqual(64, cnd.OsBits);
+		}
     }
 }


fix test

fix test

--- src/StatsN.UnitTests/StastdTests.cs
+++ src/StatsN.UnitTests/StastdTests.cs
@@ -27,47 +27,49 @@
         [Fact]
         public void ExceptionsShouldBePassed()
         {
-            Assert.Throws<ArgumentNullException>(() => Statsd.New<NullChannel>(options));
+            var opt = new StatsdOptions() { HostOrIp = null };
+            opt.OnExceptionGenerated += (sender, exception) => { throw exception; };
+            Assert.Throws<ArgumentNullException>(() => Statsd.New<NullChannel>(opt));
         }
         [Fact]
         public void BuildMetricPrefixTest()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var output = statsd.BuildMetric("awesomeMetric.yo", "1", "c", "myPrefix");
             Assert.Equal("myPrefix.awesomeMetric.yo:1|c", output);
         }
         [Fact]
         public void CorrectMetricTypesPassed()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var output = statsd.BuildMetric("awesomeMetric.yo", "1", "c", "myPrefix");
             Assert.Equal("myPrefix.awesomeMetric.yo:1|c", output);
         }
         [Fact]
         public void BadMetricNamePassed()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var output = statsd.BuildMetric("", "1", "c", "myPrefix");
             Assert.True(string.IsNullOrEmpty(output));
         }
         [Fact]
         public void BadMetricValuePassed()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var output = statsd.BuildMetric("yodawg", "", "c", "myPrefix");
             Assert.True(string.IsNullOrEmpty(output));
         }
         [Fact]
         public void BadMetricTypePassed()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var output = statsd.BuildMetric("yodawg", "1", "", "myPrefix");
             Assert.True(string.IsNullOrEmpty(output));
         }
         [Fact]
         public void BuildMetricTiming()
         {
-            var statsd = Statsd.New<NullChannel>(options);
+            var statsd = Statsd.New<NullChannel>(a => { a.HostOrIp = "localhost"; a.OnExceptionGenerated += (f, b) => { throw b; }; });
             var stopwatch = new Stopwatch();
             stopwatch.Start();
             for (int i = 0; i < 100000; i++)


Update BuildValidator to exclude refint folders.

--- src/Tools/BuildValidator/Program.cs
+++ src/Tools/BuildValidator/Program.cs
@@ -72,6 +72,7 @@
             var excludes = new List<string>(exclude ?? Array.Empty<string>());
             excludes.Add(Path.DirectorySeparatorChar + "runtimes" + Path.DirectorySeparatorChar);
             excludes.Add(Path.DirectorySeparatorChar + "ref" + Path.DirectorySeparatorChar);
+            excludes.Add(Path.DirectorySeparatorChar + "refint" + Path.DirectorySeparatorChar);
             excludes.Add(@".resources.dll");

             var options = new Options(assembliesPath, referencesPath, excludes.ToArray(), sourcePath, verbose, quiet, debug, debugPath);


better data structures

better data structures

--- src/AutoMapper/Configuration/Conventions/SourceToDestinationNameMapperAttributesMember.cs
+++ src/AutoMapper/Configuration/Conventions/SourceToDestinationNameMapperAttributesMember.cs
@@ -1,20 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
 namespace AutoMapper.Configuration.Conventions
 {
-    using System;
-    using System.Collections.Concurrent;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Reflection;
-
     public class SourceToDestinationNameMapperAttributesMember : ISourceToDestinationNameMapper
     {
-        private readonly ConcurrentDictionary<TypeDetails, Dictionary<MemberInfo, IEnumerable<SourceToDestinationMapperAttribute>>> Cache = new ConcurrentDictionary<TypeDetails, Dictionary<MemberInfo, IEnumerable<SourceToDestinationMapperAttribute>>>();
+        private readonly Dictionary<TypeDetails, SourceMember[]> allSourceMembers = new Dictionary<TypeDetails, SourceMember[]>();

         public MemberInfo GetMatchingMemberInfo(IGetTypeInfoMembers getTypeInfoMembers, TypeDetails typeInfo, Type destType, Type destMemberType, string nameToSearch)
         {
-            Cache.GetOrAdd(typeInfo, ti => getTypeInfoMembers.GetMemberInfos(ti).ToDictionary(mi => mi, mi => mi.GetCustomAttributes(typeof(SourceToDestinationMapperAttribute), true).OfType<SourceToDestinationMapperAttribute>()));
+            SourceMember[] sourceMembers;
+            if(!allSourceMembers.TryGetValue(typeInfo, out sourceMembers))
+            {
+                sourceMembers = getTypeInfoMembers.GetMemberInfos(typeInfo).Select(sourceMember => new SourceMember(sourceMember)).ToArray();
+                allSourceMembers[typeInfo] = sourceMembers;
+            }
+            return sourceMembers.FirstOrDefault(d => d.Attribute != null && d.Attribute.IsMatch(typeInfo, d.Member, destType, destMemberType, nameToSearch)).Member;
+        }

-            return Cache[typeInfo].FirstOrDefault(kp => kp.Value.Any(_ => _.IsMatch(typeInfo, kp.Key, destType, destMemberType, nameToSearch))).Key;
+        struct SourceMember
+        {
+            public SourceMember(MemberInfo sourceMember)
+            {
+                Member = sourceMember;
+                Attribute = sourceMember.GetCustomAttribute<SourceToDestinationMapperAttribute>(inherit:true);
+            }
+
+            public MemberInfo Member { get; }
+            public SourceToDestinationMapperAttribute Attribute { get; }
         }
     }
 }


Fix compile errors in test code

Fix compile errors in test code

--- src/EditorFeatures/CSharpTest/AddAccessibilityModifiers/AddAccessibilityModifiersTests.cs
+++ src/EditorFeatures/CSharpTest/AddAccessibilityModifiers/AddAccessibilityModifiersTests.cs
@@ -9,7 +9,6 @@
 using Microsoft.CodeAnalysis.Diagnostics;
 using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics;
 using Microsoft.CodeAnalysis.Test.Utilities;
-using Microsoft.CodeAnalysis.Testing;
 using Xunit;
 using VerifyCS = Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions.CSharpCodeFixVerifier<
     Microsoft.CodeAnalysis.CSharp.AddAccessibilityModifiers.CSharpAddAccessibilityModifiersDiagnosticAnalyzer,
@@ -31,12 +30,12 @@
                 {
                     Sources =
                     {
-                        @"
+                        @"using System;
 namespace Outer
 {
     namespace Inner1.Inner2
     {
-        class [|C|]
+        partial class [|C|] : I
         {
             class [|NestedClass|] { }

@@ -51,7 +50,7 @@

             event Action [|e4|] { add { } remove { } }
             public event Action e5 { add { } remove { } }
-            event Action I.e6 { add { } remote { } }
+            event Action I.e6 { add { } remove { } }

             static C() { }
             [|C|]() { }
@@ -62,15 +61,16 @@
             void [|M1|]() { }
             public void M2() { }
             void I.M3() { }
+            partial void M4();
             partial void M4() { }

             int [|P1|] { get; }
             public int P2 { get; }
             int I.P3 { get; }

-            int [|this|][int i] { get; }
-            public int this[string s] { get; }
-            int I.this[bool b] { get; }
+            int [|this|][int i] => throw null;
+            public int this[string s] => throw null;
+            int I.this[bool b] => throw null;
         }

         interface [|I|]
@@ -90,54 +90,17 @@
     }
 }",
                     },
-                    ExpectedDiagnostics =
-                    {
-                        // Test0.cs(16,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(16, 19, 16, 25).WithArguments("Action"),
-                        // Test0.cs(17,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(17, 26, 17, 32).WithArguments("Action"),
-                        // Test0.cs(19,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(19, 19, 19, 25).WithArguments("Action"),
-                        // Test0.cs(20,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(20, 26, 20, 32).WithArguments("Action"),
-                        // Test0.cs(21,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(21, 19, 21, 25).WithArguments("Action"),
-                        // Test0.cs(21,26): error CS0540: 'C.I.e6': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(21, 26, 21, 27).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(21,28): error CS0065: 'C.I.e6': event property must have both add and remove accessors
-                        DiagnosticResult.CompilerError("CS0065").WithSpan(21, 28, 21, 30).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6"),
-                        // Test0.cs(21,41): error CS1055: An add or remove accessor expected
-                        DiagnosticResult.CompilerError("CS1055").WithSpan(21, 41, 21, 47),
-                        // Test0.cs(31,18): error CS0540: 'C.I.M3()': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(31, 18, 31, 19).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.M3()", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(32,26): error CS0751: A partial method must be declared within a partial class, partial struct, or partial interface
-                        DiagnosticResult.CompilerError("CS0751").WithSpan(32, 26, 32, 28),
-                        // Test0.cs(32,26): error CS0759: No defining declaration found for implementing declaration of partial method 'C.M4()'
-                        DiagnosticResult.CompilerError("CS0759").WithSpan(32, 26, 32, 28).WithArguments("Outer.Inner1.Inner2.C.M4()"),
-                        // Test0.cs(36,17): error CS0540: 'C.I.P3': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(36, 17, 36, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.P3", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(38,31): error CS0501: 'C.this[int].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(38, 31, 38, 34).WithArguments("Outer.Inner1.Inner2.C.this[int].get"),
-                        // Test0.cs(39,41): error CS0501: 'C.this[string].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(39, 41, 39, 44).WithArguments("Outer.Inner1.Inner2.C.this[string].get"),
-                        // Test0.cs(40,17): error CS0540: 'C.I.this[bool]': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(40, 17, 40, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool]", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(40,34): error CS0501: 'C.I.this[bool].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(40, 34, 40, 37).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool].get"),
-                        // Test0.cs(45,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(45, 19, 45, 25).WithArguments("Action"),
-                    },
                 },
                 FixedState =
                 {
                     Sources =
                     {
-                        @"
+                        @"using System;
 namespace Outer
 {
     namespace Inner1.Inner2
     {
-        internal class C
+        internal partial class C : I
         {
             private class NestedClass { }

@@ -152,7 +115,7 @@

             private event Action e4 { add { } remove { } }
             public event Action e5 { add { } remove { } }
-            event Action I.e6 { add { } remote { } }
+            event Action I.e6 { add { } remove { } }

             static C() { }

@@ -164,15 +127,16 @@
             private void M1() { }
             public void M2() { }
             void I.M3() { }
+            partial void M4();
             partial void M4() { }

             private int P1 { get; }
             public int P2 { get; }
             int I.P3 { get; }

-            private int this[int i] { get; }
-            public int this[string s] { get; }
-            int I.this[bool b] { get; }
+            private int this[int i] => throw null;
+            public int this[string s] => throw null;
+            int I.this[bool b] => throw null;
         }

         internal interface I
@@ -192,43 +156,6 @@
     }
 }",
                     },
-                    ExpectedDiagnostics =
-                    {
-                        // Test0.cs(16,27): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(16, 27, 16, 33).WithArguments("Action"),
-                        // Test0.cs(17,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(17, 26, 17, 32).WithArguments("Action"),
-                        // Test0.cs(19,27): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(19, 27, 19, 33).WithArguments("Action"),
-                        // Test0.cs(20,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(20, 26, 20, 32).WithArguments("Action"),
-                        // Test0.cs(21,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(21, 19, 21, 25).WithArguments("Action"),
-                        // Test0.cs(21,26): error CS0540: 'C.I.e6': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(21, 26, 21, 27).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(21,28): error CS0065: 'C.I.e6': event property must have both add and remove accessors
-                        DiagnosticResult.CompilerError("CS0065").WithSpan(21, 28, 21, 30).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6"),
-                        // Test0.cs(21,41): error CS1055: An add or remove accessor expected
-                        DiagnosticResult.CompilerError("CS1055").WithSpan(21, 41, 21, 47),
-                        // Test0.cs(32,18): error CS0540: 'C.I.M3()': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(32, 18, 32, 19).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.M3()", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(33,26): error CS0751: A partial method must be declared within a partial class, partial struct, or partial interface
-                        DiagnosticResult.CompilerError("CS0751").WithSpan(33, 26, 33, 28),
-                        // Test0.cs(33,26): error CS0759: No defining declaration found for implementing declaration of partial method 'C.M4()'
-                        DiagnosticResult.CompilerError("CS0759").WithSpan(33, 26, 33, 28).WithArguments("Outer.Inner1.Inner2.C.M4()"),
-                        // Test0.cs(37,17): error CS0540: 'C.I.P3': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(37, 17, 37, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.P3", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(39,39): error CS0501: 'C.this[int].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(39, 39, 39, 42).WithArguments("Outer.Inner1.Inner2.C.this[int].get"),
-                        // Test0.cs(40,41): error CS0501: 'C.this[string].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(40, 41, 40, 44).WithArguments("Outer.Inner1.Inner2.C.this[string].get"),
-                        // Test0.cs(41,17): error CS0540: 'C.I.this[bool]': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(41, 17, 41, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool]", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(41,34): error CS0501: 'C.I.this[bool].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(41, 34, 41, 37).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool].get"),
-                        // Test0.cs(46,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(46, 19, 46, 25).WithArguments("Action"),
-                    },
                 },
             }.RunAsync();
         }
@@ -270,12 +197,12 @@
                 {
                     Sources =
                     {
-                        @"
+                        @"using System;
 namespace Outer
 {
     namespace Inner1.Inner2
     {
-        internal class [|C|]
+        internal partial class [|C|] : I
         {
             private class [|NestedClass|] { }

@@ -290,7 +217,7 @@

             private event Action [|e4|] { add { } remove { } }
             public event Action e5 { add { } remove { } }
-            event Action I.e6 { add { } remote { } }
+            event Action I.e6 { add { } remove { } }

             static C() { }

@@ -302,15 +229,16 @@
             private void [|M1|]() { }
             public void M2() { }
             void I.M3() { }
+            partial void M4();
             partial void M4() { }

             private int [|P1|] { get; }
             public int P2 { get; }
             int I.P3 { get; }

-            private int [|this|][int i] { get; }
-            public int this[string s] { get; }
-            int I.this[bool b] { get; }
+            private int [|this|][int i] => throw null;
+            public int this[string s] => throw null;
+            int I.this[bool b] => throw null;
         }

         internal interface [|I|]
@@ -330,54 +258,17 @@
     }
 }",
                     },
-                    ExpectedDiagnostics =
-                    {
-                        // Test0.cs(16,27): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(16, 27, 16, 33).WithArguments("Action"),
-                        // Test0.cs(17,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(17, 26, 17, 32).WithArguments("Action"),
-                        // Test0.cs(19,27): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(19, 27, 19, 33).WithArguments("Action"),
-                        // Test0.cs(20,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(20, 26, 20, 32).WithArguments("Action"),
-                        // Test0.cs(21,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(21, 19, 21, 25).WithArguments("Action"),
-                        // Test0.cs(21,26): error CS0540: 'C.I.e6': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(21, 26, 21, 27).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(21,28): error CS0065: 'C.I.e6': event property must have both add and remove accessors
-                        DiagnosticResult.CompilerError("CS0065").WithSpan(21, 28, 21, 30).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6"),
-                        // Test0.cs(21,41): error CS1055: An add or remove accessor expected
-                        DiagnosticResult.CompilerError("CS1055").WithSpan(21, 41, 21, 47),
-                        // Test0.cs(32,18): error CS0540: 'C.I.M3()': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(32, 18, 32, 19).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.M3()", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(33,26): error CS0751: A partial method must be declared within a partial class, partial struct, or partial interface
-                        DiagnosticResult.CompilerError("CS0751").WithSpan(33, 26, 33, 28),
-                        // Test0.cs(33,26): error CS0759: No defining declaration found for implementing declaration of partial method 'C.M4()'
-                        DiagnosticResult.CompilerError("CS0759").WithSpan(33, 26, 33, 28).WithArguments("Outer.Inner1.Inner2.C.M4()"),
-                        // Test0.cs(37,17): error CS0540: 'C.I.P3': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(37, 17, 37, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.P3", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(39,39): error CS0501: 'C.this[int].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(39, 39, 39, 42).WithArguments("Outer.Inner1.Inner2.C.this[int].get"),
-                        // Test0.cs(40,41): error CS0501: 'C.this[string].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(40, 41, 40, 44).WithArguments("Outer.Inner1.Inner2.C.this[string].get"),
-                        // Test0.cs(41,17): error CS0540: 'C.I.this[bool]': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(41, 17, 41, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool]", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(41,34): error CS0501: 'C.I.this[bool].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(41, 34, 41, 37).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool].get"),
-                        // Test0.cs(46,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(46, 19, 46, 25).WithArguments("Action"),
-                    },
                 },
                 FixedState =
                 {
                     Sources =
                     {
-                        @"
+                        @"using System;
 namespace Outer
 {
     namespace Inner1.Inner2
     {
-        class C
+        partial class C : I
         {
             class NestedClass { }

@@ -392,7 +283,7 @@

             event Action e4 { add { } remove { } }
             public event Action e5 { add { } remove { } }
-            event Action I.e6 { add { } remote { } }
+            event Action I.e6 { add { } remove { } }

             static C() { }

@@ -404,15 +295,16 @@
             void M1() { }
             public void M2() { }
             void I.M3() { }
+            partial void M4();
             partial void M4() { }

             int P1 { get; }
             public int P2 { get; }
             int I.P3 { get; }

-            int this[int i] { get; }
-            public int this[string s] { get; }
-            int I.this[bool b] { get; }
+            int this[int i] => throw null;
+            public int this[string s] => throw null;
+            int I.this[bool b] => throw null;
         }

         interface I
@@ -431,43 +323,6 @@
         }
     }
 }",
-                    },
-                    ExpectedDiagnostics =
-                    {
-                        // Test0.cs(16,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(16, 19, 16, 25).WithArguments("Action"),
-                        // Test0.cs(17,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(17, 26, 17, 32).WithArguments("Action"),
-                        // Test0.cs(19,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(19, 19, 19, 25).WithArguments("Action"),
-                        // Test0.cs(20,26): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(20, 26, 20, 32).WithArguments("Action"),
-                        // Test0.cs(21,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(21, 19, 21, 25).WithArguments("Action"),
-                        // Test0.cs(21,26): error CS0540: 'C.I.e6': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(21, 26, 21, 27).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(21,28): error CS0065: 'C.I.e6': event property must have both add and remove accessors
-                        DiagnosticResult.CompilerError("CS0065").WithSpan(21, 28, 21, 30).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.e6"),
-                        // Test0.cs(21,41): error CS1055: An add or remove accessor expected
-                        DiagnosticResult.CompilerError("CS1055").WithSpan(21, 41, 21, 47),
-                        // Test0.cs(32,18): error CS0540: 'C.I.M3()': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(32, 18, 32, 19).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.M3()", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(33,26): error CS0751: A partial method must be declared within a partial class, partial struct, or partial interface
-                        DiagnosticResult.CompilerError("CS0751").WithSpan(33, 26, 33, 28),
-                        // Test0.cs(33,26): error CS0759: No defining declaration found for implementing declaration of partial method 'C.M4()'
-                        DiagnosticResult.CompilerError("CS0759").WithSpan(33, 26, 33, 28).WithArguments("Outer.Inner1.Inner2.C.M4()"),
-                        // Test0.cs(37,17): error CS0540: 'C.I.P3': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(37, 17, 37, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.P3", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(39,31): error CS0501: 'C.this[int].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(39, 31, 39, 34).WithArguments("Outer.Inner1.Inner2.C.this[int].get"),
-                        // Test0.cs(40,41): error CS0501: 'C.this[string].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(40, 41, 40, 44).WithArguments("Outer.Inner1.Inner2.C.this[string].get"),
-                        // Test0.cs(41,17): error CS0540: 'C.I.this[bool]': containing type does not implement interface 'I'
-                        DiagnosticResult.CompilerError("CS0540").WithSpan(41, 17, 41, 18).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool]", "Outer.Inner1.Inner2.I"),
-                        // Test0.cs(41,34): error CS0501: 'C.I.this[bool].get' must declare a body because it is not marked abstract, extern, or partial
-                        DiagnosticResult.CompilerError("CS0501").WithSpan(41, 34, 41, 37).WithArguments("Outer.Inner1.Inner2.C.Outer.Inner1.Inner2.I.this[bool].get"),
-                        // Test0.cs(46,19): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?)
-                        DiagnosticResult.CompilerError("CS0246").WithSpan(46, 19, 46, 25).WithArguments("Action"),
                     },
                 },
                 Options =


Allow prerendering middleware to pass through non-prerendered responses (important when using dev middleware)

--- src/Microsoft.AspNetCore.SpaServices.Extensions/Prerendering/SpaPrerenderingExtensions.cs
+++ src/Microsoft.AspNetCore.SpaServices.Extensions/Prerendering/SpaPrerenderingExtensions.cs
@@ -113,21 +113,19 @@
                         context.Response.Body = originalResponseStream;
                     }

-                    // If it's not a success response, we're not going to have any template HTML
-                    // to pass to the prerenderer.
-                    if (context.Response.StatusCode < 200 || context.Response.StatusCode >= 300)
-                    {
-                        var message = $"Prerendering failed because no HTML template could be obtained. " +
-                            $"Check that your SPA is compiling without errors. " +
-                            $"The {nameof(SpaApplicationBuilderExtensions.UseSpa)}() middleware returned " +
-                            $"a response with status code {context.Response.StatusCode}.";
-                        if (outputBuffer.Length > 0)
-                        {
-                            message += " and the following content: "
-                                + Encoding.UTF8.GetString(outputBuffer.GetBuffer());
-                        }
-
-                        throw new InvalidOperationException(message);
+                    // If it isn't an HTML page that we can use as the template for prerendering,
+                    //  - ... because it's not text/html
+                    //  - ... or because it's an error
+                    // then prerendering doesn't apply to this request, so just pass through the
+                    // response as-is. Note that the non-text/html case is not an error: this is
+                    // typically how the SPA dev server responses for static content are returned
+                    // in development mode.
+                    var canPrerender = IsSuccessStatusCode(context.Response.StatusCode)
+                        && IsHtmlContentType(context.Response.ContentType);
+                    if (!canPrerender)
+                    {
+                        await outputBuffer.CopyToAsync(context.Response.Body);
+                        return;
                     }

                     // Most prerendering logic will want to know about the original, unprerendered
@@ -160,6 +158,20 @@
             });
         }

+        private static bool IsHtmlContentType(string contentType)
+        {
+            if (string.Equals(contentType, "text/html", StringComparison.Ordinal))
+            {
+                return true;
+            }
+
+            return contentType != null
+                && contentType.StartsWith("text/html;", StringComparison.Ordinal);
+        }
+
+        private static bool IsSuccessStatusCode(int statusCode)
+            => statusCode >= 200 && statusCode < 300;
+
         private static void RemoveConditionalRequestHeaders(HttpRequest request)
         {
             request.Headers.Remove(HeaderNames.IfMatch);


Don't use Task.Run

Don't use Task.Run

--- osu.Framework.Tests/IO/BackgroundGameHeadlessGameHost.cs
+++ osu.Framework.Tests/IO/BackgroundGameHeadlessGameHost.cs
@@ -2,7 +2,6 @@
 // See the LICENCE file in the repository root for full licence text.

 using System.Threading;
-using System.Threading.Tasks;
 using osu.Framework.Platform;

 namespace osu.Framework.Tests.IO
@@ -17,8 +16,7 @@
         public BackgroundGameHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true, bool portableInstallation = false)
             : base(gameName, bindIPC, realtime, portableInstallation)
         {
-            // ReSharper disable once AccessToDisposedClosure
-            Task.Run(() => Run(testGame = new TestGame()));
+            new Thread(() => Run(testGame = new TestGame())).Start();

             while (ExecutionState != ExecutionState.Stopped && testGame?.HasProcessed != true)
                 Thread.Sleep(10);


Fix room status test scene not working

Fix room status test scene not working

--- osu.Game.Tests/Visual/Multiplayer/TestSceneRoomStatus.cs
+++ osu.Game.Tests/Visual/Multiplayer/TestSceneRoomStatus.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Game.Online.Multiplayer;
@@ -22,18 +23,21 @@
                     new DrawableRoom(new Room
                     {
                         Name = { Value = "Room 1" },
-                        Status = { Value = new RoomStatusOpen() }
-                    }),
+                        Status = { Value = new RoomStatusOpen() },
+                        EndDate = { Value = DateTimeOffset.Now.AddDays(1) }
+                    }) { MatchingFilter = true },
                     new DrawableRoom(new Room
                     {
                         Name = { Value = "Room 2" },
-                        Status = { Value = new RoomStatusPlaying() }
-                    }),
+                        Status = { Value = new RoomStatusPlaying() },
+                        EndDate = { Value = DateTimeOffset.Now.AddDays(1) }
+                    }) { MatchingFilter = true },
                     new DrawableRoom(new Room
                     {
                         Name = { Value = "Room 3" },
-                        Status = { Value = new RoomStatusEnded() }
-                    }),
+                        Status = { Value = new RoomStatusEnded() },
+                        EndDate = { Value = DateTimeOffset.Now }
+                    }) { MatchingFilter = true },
                 }
             };
         }


master-patch_01 Gateway ------------------------ Update Airtime URL


Move result creation to load(), add exceptions

--- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
+++ osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using osu.Framework.Allocation;
 using osu.Framework.Configuration;
+using osu.Framework.Extensions.TypeExtensions;
 using osu.Game.Audio;
 using osu.Game.Graphics;
 using osu.Game.Rulesets.Judgements;
@@ -70,7 +71,7 @@
         /// <summary>
         /// The scoring result of this <see cref="DrawableHitObject"/>.
         /// </summary>
-        public readonly JudgementResult Result;
+        public JudgementResult Result { get; private set; }

         private bool judgementOccurred;

@@ -87,14 +88,19 @@
         protected DrawableHitObject(HitObject hitObject)
         {
             HitObject = hitObject;
-
-            if (hitObject.Judgement != null)
-                Result = CreateJudgementResult(hitObject.Judgement);
         }

         [BackgroundDependencyLoader]
         private void load()
         {
+            if (HitObject.Judgement != null)
+            {
+                Result = CreateJudgementResult(HitObject.Judgement);
+
+                if (Result == null)
+                    throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateJudgementResult)}.");
+            }
+
             var samples = GetSamples().ToArray();

             if (samples.Any())
@@ -187,6 +193,9 @@
         protected void ApplyResult(Action<JudgementResult> application)
         {
             application?.Invoke(Result);
+
+            if (!Result.HasResult)
+                throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");

             judgementOccurred = true;


Improves Add Workitem Link functionality

Make Add Link functionality:
 * Accept ForwardEnd and ReverseEnd,
 * Case insensitive
 * Accept both Name as well as ImmutableName.

--- Aggregator.Core/Facade/WorkItemWrapper.cs
+++ Aggregator.Core/Facade/WorkItemWrapper.cs
@@ -182,9 +182,29 @@

         public void AddWorkItemLink(IWorkItemExposed destination, string linkTypeName)
         {
-            var destLinkType = this.workItem.Store.WorkItemLinkTypes
-                .FirstOrDefault(t => t.ForwardEnd.Name == linkTypeName)
-                .ForwardEnd;
+            WorkItemLinkType workItemLinkType = this.workItem.Store.WorkItemLinkTypes
+                .FirstOrDefault(
+                    t => new string[] { t.ForwardEnd.ImmutableName, t.ForwardEnd.Name, t.ReverseEnd.ImmutableName, t.ReverseEnd.Name }
+                        .Contains(linkTypeName, StringComparer.OrdinalIgnoreCase));
+
+            if (workItemLinkType == null)
+            {
+                throw new ArgumentOutOfRangeException(nameof(linkTypeName));
+            }
+
+            WorkItemLinkTypeEnd destLinkType;
+
+            if (
+                new string[] { workItemLinkType.ForwardEnd.ImmutableName, workItemLinkType.ForwardEnd.Name }
+                    .Contains(linkTypeName, StringComparer.OrdinalIgnoreCase))
+            {
+                destLinkType = workItemLinkType.ForwardEnd;
+            }
+            else
+            {
+                destLinkType = workItemLinkType.ReverseEnd;
+            }
+
             var relationship = new WorkItemLink(destLinkType, this.Id, destination.Id);

             // check it does not exist already


Unrelated - Ensure action is used with GET only

--- Agiil.Web/Controllers/LabelsController.cs
+++ Agiil.Web/Controllers/LabelsController.cs
@@ -14,6 +14,7 @@
     readonly IGetsListOfLabels labelLister;
     readonly IMapper mapper;

+    [HttpGet]
     public ActionResult Index()
     {
       var labels = labelLister.GetAllLabels();


Fix move-azureservice due to client library bug.

--- src/ServiceManagement/Compute/Commands.ServiceManagement/Migration/MigrateAzureService.cs
+++ src/ServiceManagement/Compute/Commands.ServiceManagement/Migration/MigrateAzureService.cs
@@ -160,8 +160,11 @@
             else
             {
                 var parameter = new PrepareDeploymentMigrationParameters
-                {
-                    DestinationVirtualNetwork = this.DestinationVNetType
+                { // TODO: Fix later due to client library bug
+                    DestinationVirtualNetwork = this.DestinationVNetType,
+                    ResourceGroupName = string.Empty,
+                    SubNetName = string.Empty,
+                    VirtualNetworkName = string.Empty
                 };

                 if (this.DestinationVNetType.Equals(DestinationVirtualNetwork.Existing))


Invalid media query will end up as valid media rule with not all

--- AngleSharp.Core.Tests/Css/CssMediaList.cs
+++ AngleSharp.Core.Tests/Css/CssMediaList.cs
@@ -37,7 +37,11 @@
     h1 { color: green }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -172,7 +176,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -182,7 +190,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -192,7 +204,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -202,7 +218,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -213,7 +233,11 @@
 }";

             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -224,9 +248,10 @@
 }
 h1 { color: green }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(1, sheet.Rules.Length);
-            Assert.IsInstanceOf<ICssStyleRule>(sheet.Rules[0]);
-            var style = (ICssStyleRule)sheet.Rules[0];
+            Assert.AreEqual(2, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            Assert.IsInstanceOf<ICssStyleRule>(sheet.Rules[1]);
+            var style = (ICssStyleRule)sheet.Rules[1];
             Assert.AreEqual("rgb(0, 128, 0)", style.Style.Color);
             Assert.AreEqual("h1", style.SelectorText);
         }
@@ -238,7 +263,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]
@@ -248,7 +277,11 @@
     h1 { color: red }
 }";
             var sheet = ParseStyleSheet(source);
-            Assert.AreEqual(0, sheet.Rules.Length);
+            Assert.AreEqual(1, sheet.Rules.Length);
+            Assert.AreEqual(CssRuleType.Media, sheet.Rules[0].Type);
+            var media = sheet.Rules[0] as ICssMediaRule;
+            Assert.AreEqual("not all", media.ConditionText);
+            Assert.AreEqual(1, media.Rules.Length);
         }

         [Test]


Stringification partially implemented

Stringification partially implemented

--- AngleSharp/DOM/Css/CSSStyleDeclaration.cs
+++ AngleSharp/DOM/Css/CSSStyleDeclaration.cs
@@ -4,6 +4,7 @@
     using System;
     using System.Collections;
     using System.Collections.Generic;
+    using System.Linq;

     /// <summary>
     /// Represents a single CSS declaration block.
@@ -2289,7 +2290,7 @@

             if (CssPropertyFactory.IsShorthand(propertyName))
             {
-                var longhands = CssPropertyFactory.GetMapping(propertyName);
+                var longhands = CssPropertyFactory.GetLonghands(propertyName);

                 foreach (var longhand in longhands)
                     RemoveProperty(longhand);
@@ -2314,7 +2315,7 @@

             if (CssPropertyFactory.IsShorthand(propertyName))
             {
-                var longhands = CssPropertyFactory.GetMapping(propertyName);
+                var longhands = CssPropertyFactory.GetLonghands(propertyName);

                 foreach (var longhand in longhands)
                 {
@@ -2339,7 +2340,7 @@
         {
             if (CssPropertyFactory.IsShorthand(propertyName))
             {
-                var declarations = CssPropertyFactory.GetMapping(propertyName);
+                var declarations = CssPropertyFactory.GetLonghands(propertyName);

                 foreach (var declaration in declarations)
                     if (this[declaration] == null)
@@ -2373,8 +2374,8 @@
                 return;

             var important = !String.IsNullOrEmpty(priority);
-            var mappings = CssPropertyFactory.GetMapping(propertyName);
-
+            var mappings = CssPropertyFactory.IsShorthand(propertyName) ? CssPropertyFactory.GetLonghands(propertyName) : Enumerable.Repeat(propertyName, 1);
+
             foreach (var mapping in mappings)
             {
                 var property = GetProperty(mapping);
@@ -2502,26 +2503,41 @@
                 if (serialized.Contains(property))
                     continue;

-                //3. If property maps to one or more shorthand properties, let shorthands be an array of those shorthand properties, in preferred order, and follow these substeps:
-                /*
-                    if (rule is CSSShorthandProperty)
+                var shorthands = CssPropertyFactory.GetShorthands(property);
+
+                if (shorthands.Any())
+                {
+                    var longhands = _rules.Where(m => !serialized.Contains(m.Name)).ToList();
+
+                    foreach (var shorthand in shorthands.OrderByDescending(m => CssPropertyFactory.GetLonghands(m).Count()))
                     {
-                        var longhands = ((CSSShorthandProperty)rule).Properties;
-                        var currentLonghands = new List<String>();
+                        var properties = CssPropertyFactory.GetLonghands(shorthand);
+                        var currentLonghands = longhands.Where(m => properties.Contains(m.Name)).ToList();
+
+                        if (currentLonghands.Count == 0)
+                            continue;
+
+                        var important = currentLonghands.Count(m => m.IsImportant);
+
+                        if (important > 0 && important != currentLonghands.Count)
+                            continue;
+
+                        continue;
+
+                        //    5. Let value be the result of invoking serialize a CSS value of current longhands.
+                        //    6. If value is the empty string, continue with the steps labeled shorthand loop.
+                        //    7. Let serialized declaration be the result of invoking serialize a CSS declaration with
+                        //       property name shorthand, value value, and the important flag set if the CSS declarations
+                        //       in current longhands have their important flag set.
+                        //    8. Append serialized declaration to list.
+
+                        foreach (var longhand in currentLonghands)
+                        {
+                            serialized.Add(longhand.Name);
+                            longhands.Remove(longhand);
+                        }
                     }
-                 */
-                //  1. Let longhands be an array consisting of all CSS declarations in declaration block's declarations that that are not in already serialized and have a property name that maps to one of the shorthand properties in shorthands.
-                //  2. Shorthand loop: For each shorthand in shorthands, follow these substeps:
-                //    1. If all properties that map to shorthand are not present in longhands, continue with the steps labeled shorthand loop.
-                //    2. Let current longhands be an empty array.
-                //    3. Append all CSS declarations in longhands have a property name that maps to shorthand to current longhands.
-                //    4. If there is one or more CSS declarations in current longhands have their important flag set and one or more with it unset, continue with the steps labeled shorthand loop.
-                //    5. Let value be the result of invoking serialize a CSS value of current longhands.
-                //    6. If value is the empty string, continue with the steps labeled shorthand loop.
-                //    7. Let serialized declaration be the result of invoking serialize a CSS declaration with property name shorthand, value value, and the important flag set if the CSS declarations in current longhands have their important flag set.
-                //    8. Append serialized declaration to list.
-                //    9. Append the property names of all items of current longhands to already serialized.
-                //    10. Remove the items present in current longhands from longhands.
+                }

                 if (serialized.Contains(property))
                     continue;


I swear no more bumps tonight

I swear no more bumps tonight

--- ArchiSteamFarm/Properties/AssemblyInfo.cs
+++ ArchiSteamFarm/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0.7")]
-[assembly: AssemblyFileVersion("2.0.0.7")]
+[assembly: AssemblyVersion("2.0.0.8")]
+[assembly: AssemblyFileVersion("2.0.0.8")]


Adding Delay to the NO syllabus it should work now

--- Assets/Core/Audio/Scripts/AudioManager.cs
+++ Assets/Core/Audio/Scripts/AudioManager.cs
@@ -439,9 +439,15 @@

 	public void FemaleNoSoundPlay()
 	{
-		SideKick.clip = FemaleNoSound;
-		SideKick.Play ();
-	}
+	    StartCoroutine(NoSyllabus());
+	}
+
+    IEnumerator NoSyllabus()
+    {
+        yield return new WaitForSeconds(1f);
+        SideKick.clip = FemaleNoSound;
+        SideKick.Play();
+    }

 	public void SidekickRandomGibberishPlay()
 	{


Update version.

Update version.

--- CSharp/Library/Properties/AssemblyInfo.cs
+++ CSharp/Library/Properties/AssemblyInfo.cs
@@ -32,8 +32,8 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.9.0.29")]
-[assembly: AssemblyFileVersion("0.9.0.29")]
+[assembly: AssemblyVersion("0.9.0.30")]
+[assembly: AssemblyFileVersion("0.9.0.30")]

 [assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]


Fix to get rid of compiler warning

Fix to get rid of compiler warning

--- CakeMail.RestClient/CakeMailRestClient.cs
+++ CakeMail.RestClient/CakeMailRestClient.cs
@@ -292,7 +292,7 @@
 			};
 			if (name != null) parameters.Add(new KeyValuePair<string, object>("company_name", name));
 			if (status != null) parameters.Add(new KeyValuePair<string, object>("status", status));
-			if (parentId.HasValue != null) parameters.Add(new KeyValuePair<string, object>("parent_id", parentId.Value));
+			if (parentId.HasValue) parameters.Add(new KeyValuePair<string, object>("parent_id", parentId.Value));
 			if (address1 != null) parameters.Add(new KeyValuePair<string, object>("address1", address1));
 			if (address2 != null) parameters.Add(new KeyValuePair<string, object>("address2", address2));
 			if (city != null) parameters.Add(new KeyValuePair<string, object>("city", city));
@@ -426,7 +426,7 @@
 				new KeyValuePair<string, object>("user_key", userKey),
 				new KeyValuePair<string, object>("list_id", listId)
 			};
-			//if (subListId.HasValue) parameters.Add(new KeyValuePair<string, object>("sublist_id", subListId.Value));
+			if (subListId.HasValue) parameters.Add(new KeyValuePair<string, object>("sublist_id", subListId.Value));
 			parameters.Add(new KeyValuePair<string, object>("no_details", includeDetails ? "false" : "true"));	// CakeMail expects 'false' if you want to include details
 			parameters.Add(new KeyValuePair<string, object>("with_engagement", calculateEngagement ? "true" : "false"));
 			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));


DefaultRequestHandler - Revert changes and just mark Obsolete

--- CefSharp/Handler/DefaultRequestHandler.cs
+++ CefSharp/Handler/DefaultRequestHandler.cs
@@ -1,14 +1,191 @@
-// Copyright © 2019 The CefSharp Authors. All rights reserved.
+// Copyright © 2014 The CefSharp Authors. All rights reserved.
 //
 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

 using System;
+using System.Security.Cryptography.X509Certificates;

 namespace CefSharp.Handler
 {
-    /// <inheritdoc/>>
-    [Obsolete("Use RequestHandler instead.")]
-    public class DefaultRequestHandler : RequestHandler
+    /// <summary>
+    /// Default implementation of <see cref="IRequestHandler"/>.
+    /// This class provides default implementations of the methods from <see cref="IRequestHandler"/>,
+    /// therefore providing a convenience base class for any custom request handler.
+    /// </summary>
+    [Obsolete("This class is now obsolete, inherit from RequestHandler instead.")]
+    public class DefaultRequestHandler : IRequestHandler
     {
+        /// <summary>
+        /// Called before browser navigation.
+        /// If the navigation is allowed <see cref="IWebBrowser.FrameLoadStart"/> and <see cref="IWebBrowser.FrameLoadEnd"/>
+        /// will be called. If the navigation is canceled <see cref="IWebBrowser.LoadError"/> will be called with an ErrorCode
+        /// value of <see cref="CefErrorCode.Aborted"/>.
+        /// </summary>
+        /// <param name="browserControl">the ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="frame">The frame the request is coming from</param>
+        /// <param name="request">the request object - cannot be modified in this callback</param>
+        /// <param name="userGesture">The value will be true if the browser navigated via explicit user gesture
+        /// (e.g. clicking a link) or false if it navigated automatically (e.g. via the DomContentLoaded event).</param>
+        /// <param name="isRedirect">has the request been redirected</param>
+        /// <returns>Return true to cancel the navigation or false to allow the navigation to proceed.</returns>
+        public virtual bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect)
+        {
+            return false;
+        }
+
+        /// <summary>
+        /// Called on the UI thread before OnBeforeBrowse in certain limited cases
+        /// where navigating a new or different browser might be desirable. This
+        /// includes user-initiated navigation that might open in a special way (e.g.
+        /// links clicked via middle-click or ctrl + left-click) and certain types of
+        /// cross-origin navigation initiated from the renderer process (e.g.
+        /// navigating the top-level frame to/from a file URL).
+        /// </summary>
+        /// <param name="browserControl">the ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="frame">The frame object</param>
+        /// <param name="targetUrl">target url</param>
+        /// <param name="targetDisposition">The value indicates where the user intended to navigate the browser based
+        /// on standard Chromium behaviors (e.g. current tab, new tab, etc). </param>
+        /// <param name="userGesture">The value will be true if the browser navigated via explicit user gesture
+        /// (e.g. clicking a link) or false if it navigated automatically (e.g. via the DomContentLoaded event).</param>
+        /// <returns>Return true to cancel the navigation or false to allow the navigation
+        /// to proceed in the source browser's top-level frame.</returns>
+        public virtual bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl,
+            WindowOpenDisposition targetDisposition, bool userGesture)
+        {
+            return false;
+        }
+
+        /// <summary>
+        /// Called on the CEF IO thread before a resource request is initiated.
+        /// </summary>
+        /// <param name="chromiumWebBrowser">the ChromiumWebBrowser control</param>
+        /// <param name="browser">represent the source browser of the request</param>
+        /// <param name="frame">represent the source frame of the request</param>
+        /// <param name="request">represents the request contents and cannot be modified in this callback</param>
+        /// <param name="iNavigation">will be true if the resource request is a navigation</param>
+        /// <param name="isDownload">will be true if the resource request is a download</param>
+        /// <param name="requestInitiator">is the origin (scheme + domain) of the page that initiated the request</param>
+        /// <param name="disableDefaultHandling">to true to disable default handling of the request, in which case it will need to be handled via <see cref="IResourceRequestHandler.GetResourceHandler"/> or it will be canceled</param>
+        /// <returns>To allow the resource load to proceed with default handling return null. To specify a handler for the resource return a <see cref="IResourceRequestHandler"/> object. If this callback returns null the same method will be called on the associated <see cref="IRequestContextHandler"/>, if any</returns>
+        public virtual IResourceRequestHandler GetResourceRequestHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool iNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling)
+        {
+            return null;
+        }
+
+        /// <summary>
+        /// Called when the browser needs credentials from the user.
+        /// </summary>
+        /// <param name="browserControl">The ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="frame">The frame object that needs credentials (This will contain the URL that is being requested.)</param>
+        /// <param name="isProxy">indicates whether the host is a proxy server</param>
+        /// <param name="host">hostname</param>
+        /// <param name="port">port number</param>
+        /// <param name="realm">realm</param>
+        /// <param name="scheme">scheme</param>
+        /// <param name="callback">Callback interface used for asynchronous continuation of authentication requests.</param>
+        /// <returns>Return true to continue the request and call CefAuthCallback::Continue() when the authentication information is available. Return false to cancel the request. </returns>
+        public virtual bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host,
+            int port, string realm, string scheme, IAuthCallback callback)
+        {
+            callback.Dispose();
+            return false;
+        }
+
+        /// <summary>
+        /// Called when JavaScript requests a specific storage quota size via the webkitStorageInfo.requestQuota function.
+        /// For async processing return true and execute <see cref="IRequestCallback.Continue"/> at a later time to
+        /// grant or deny the request or <see cref="IRequestCallback.Cancel"/> to cancel.
+        /// </summary>
+        /// <param name="browserControl">The ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="originUrl">the origin of the page making the request</param>
+        /// <param name="newSize">is the requested quota size in bytes</param>
+        /// <param name="callback">Callback interface used for asynchronous continuation of url requests.</param>
+        /// <returns>Return false to cancel the request immediately. Return true to continue the request
+        /// and call <see cref="IRequestCallback.Continue"/> either in this method or at a later time to
+        /// grant or deny the request.</returns>
+        public virtual bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize,
+            IRequestCallback callback)
+        {
+            callback.Dispose();
+            return false;
+        }
+
+        /// <summary>
+        /// Called to handle requests for URLs with an invalid SSL certificate.
+        /// Return true and call <see cref="IRequestCallback.Continue"/> either
+        /// in this method or at a later time to continue or cancel the request.
+        /// If CefSettings.IgnoreCertificateErrors is set all invalid certificates
+        /// will be accepted without calling this method.
+        /// </summary>
+        /// <param name="browserControl">the ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="errorCode">the error code for this invalid certificate</param>
+        /// <param name="requestUrl">the url of the request for the invalid certificate</param>
+        /// <param name="sslInfo">ssl certificate information</param>
+        /// <param name="callback">Callback interface used for asynchronous continuation of url requests.
+        /// If empty the error cannot be recovered from and the request will be canceled automatically.</param>
+        /// <returns>Return false to cancel the request immediately. Return true and use <see cref="IRequestCallback"/> to
+        /// execute in an async fashion.</returns>
+        public virtual bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl,
+            ISslInfo sslInfo, IRequestCallback callback)
+        {
+            callback.Dispose();
+            return false;
+        }
+
+        /// <summary>
+        /// Called when the browser needs user to select Client Certificate for authentication requests (eg. PKI authentication).
+        /// </summary>
+        /// <param name="browserControl">The ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="isProxy">indicates whether the host is a proxy server</param>
+        /// <param name="host">hostname</param>
+        /// <param name="port">port number</param>
+        /// <param name="certificates">List of Client certificates for selection</param>
+        /// <param name="callback">Callback interface used for asynchronous continuation of client certificate selection for authentication requests.</param>
+        /// <returns>Return true to continue the request and call ISelectClientCertificateCallback.Select() with the selected certificate for authentication.
+        /// Return false to use the default behavior where the browser selects the first certificate from the list. </returns>
+        public virtual bool OnSelectClientCertificate(IWebBrowser browserControl, IBrowser browser, bool isProxy, string host, int port,
+            X509Certificate2Collection certificates, ISelectClientCertificateCallback callback)
+        {
+            callback.Dispose();
+            return false;
+        }
+
+        /// <summary>
+        /// Called when a plugin has crashed
+        /// </summary>
+        /// <param name="browserControl">the ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="pluginPath">path of the plugin that crashed</param>
+        public virtual void OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath)
+        {
+        }
+
+        /// <summary>
+        /// Called on the CEF UI thread when the render view associated
+        /// with browser is ready to receive/handle IPC messages in the render
+        /// process.
+        /// </summary>
+        /// <param name="browserControl">The ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        public virtual void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser)
+        {
+        }
+
+        /// <summary>
+        /// Called when the render process terminates unexpectedly.
+        /// </summary>
+        /// <param name="browserControl">The ChromiumWebBrowser control</param>
+        /// <param name="browser">the browser object</param>
+        /// <param name="status">indicates how the process terminated.</param>
+        public virtual void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status)
+        {
+        }
     }
 }


add outcomes

add outcomes

--- Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
+++ Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
@@ -67,6 +67,7 @@
         //IAdvertise
         public string[] reactions { get; set; }
         public string report_number { get; set; }
+        public string[] outcomes { get; set; }

     }
 }


Using removed.

Using removed.

--- CleanCode/src/CleanCode/Features/TooManyChainedReferences/TooManyChainedReferencesCheck.cs
+++ CleanCode/src/CleanCode/Features/TooManyChainedReferences/TooManyChainedReferencesCheck.cs
@@ -7,14 +7,11 @@
 using JetBrains.ReSharper.Psi.Tree;
 using System.Collections.Generic;
 using System.Linq;
-using CleanCode.Features.ChainedReferences;
 using JetBrains.ReSharper.Psi;

 namespace CleanCode.Features.TooManyChainedReferences
 {
-    using JetBrains.DocumentModel;
-
     public class TooManyChainedReferencesCheck : SimpleCheck<IReferenceExpression, int>
     {
         public TooManyChainedReferencesCheck(IContextBoundSettingsStore settingsStore)


Helper support for custom subgrid. Resolves #14

--- Lib.AspNetCore.Mvc.JqGrid.Helper/InternalHelpers/JqGridSubgridJavaScriptRenderingHelper.cs
+++ Lib.AspNetCore.Mvc.JqGrid.Helper/InternalHelpers/JqGridSubgridJavaScriptRenderingHelper.cs
@@ -38,6 +38,11 @@
                     .AppendJavaScriptObjectFieldClosing()
                     .AppendJavaScriptArrayFieldClosing();
             }
+            else if (options.SubgridEnabled && !String.IsNullOrWhiteSpace(options.SubGridRowExpanded))
+            {
+                javaScriptBuilder.AppendCoreSubgridOptions(options)
+                    .AppendJavaScriptObjectFunctionField(JqGridOptionsNames.SUBGRID_ROW_EXPANDED, options.SubGridRowExpanded);
+            }

             return javaScriptBuilder;
         }


Fix contracts of ObservableCollection

Fix contracts of ObservableCollection

--- Microsoft.Research/Contracts/System/System.Collections.ObjectModel.ObservableCollection.cs
+++ Microsoft.Research/Contracts/System/System.Collections.ObjectModel.ObservableCollection.cs
@@ -121,8 +121,8 @@
         //     The zero-based index specifying the new location of the item.
         public void Move(int oldIndex, int newIndex)
         {
-            Contract.Requires(oldIndex < Count);
-            Contract.Requires(newIndex < Count);
+            Contract.Requires((oldIndex >= 0) && (oldIndex < Count));
+            Contract.Requires((newIndex >= 0) && (newIndex < Count));
         }
         //
         // Summary:
@@ -136,8 +136,8 @@
         //     The zero-based index specifying the new location of the item.
         protected virtual void MoveItem(int oldIndex, int newIndex)
         {
-            Contract.Requires(oldIndex < Count);
-            Contract.Requires(newIndex < Count);
+            Contract.Requires((oldIndex >= 0) && (oldIndex < Count));
+            Contract.Requires((newIndex >= 0) && (newIndex < Count));
         }
         //
         // Summary:


Removed null verification from repository so we can fail when necessary

--- CmsEngine.Data/Repositories/Repository.cs
+++ CmsEngine.Data/Repositories/Repository.cs
@@ -82,60 +82,40 @@

         public async Task Insert(TEntity entity)
         {
-            if (entity != null)
-            {
-                await dbContext.Set<TEntity>().AddAsync(entity);
-            }
+            await dbContext.Set<TEntity>().AddAsync(entity);
         }

         public async Task InsertRange(IEnumerable<TEntity> entities)
         {
-            if (entities != null)
-            {
-                await dbContext.Set<TEntity>().AddRangeAsync(entities);
-            }
+            await dbContext.Set<TEntity>().AddRangeAsync(entities);
         }

         public void Update(TEntity entity)
         {
-            if (entity != null)
-            {
-                //Attach(entity);
-                //dbContext.Entry(entity).State = EntityState.Modified;
-                dbContext.Update(entity);
-            }
+            dbContext.Update(entity);
         }

         public void UpdateRange(IEnumerable<TEntity> entities)
         {
-            if (entities != null)
-            {
-                dbContext.UpdateRange(entities);
-            }
+            dbContext.UpdateRange(entities);
         }

         public void Delete(TEntity entity)
         {
-            if (entity != null)
-            {
-                // We never delete anything
-                entity.IsDeleted = true;
-                Update(entity);
-            }
+            // We never delete anything, only update the IsDelete flag
+            entity.IsDeleted = true;
+            Update(entity);
         }

         public void DeleteRange(IEnumerable<TEntity> entities)
         {
-            if (entities != null)
+            for (int i = 0; i < entities.Count(); i++)
             {
-                for (int i = 0; i < entities.Count(); i++)
-                {
-                    ((List<TEntity>)entities)[i].IsDeleted = true;
-                }
+                ((List<TEntity>)entities)[i].IsDeleted = true;
+            }

-                // We never delete anything
-                UpdateRange(entities);
-            }
+            // We never delete anything
+            UpdateRange(entities);
         }

         private void Attach(TEntity entity)


Fixing Coroutine Analyzer tests

Fixing Coroutine Analyzer tests

Typo in the test code

--- UnityEngineAnalyzer/UnityEngineAnalyzer.Test/Coroutines/DoNotUseCoroutinesAnalyzerTests.cs
+++ UnityEngineAnalyzer/UnityEngineAnalyzer.Test/Coroutines/DoNotUseCoroutinesAnalyzerTests.cs
@@ -23,7 +23,7 @@
 {
     void M()
     {
-        [|StartCoroutine("")|];
+        [|StartCoroutine(""MyCoroutine"")|];
     }
 }";
             Document document;
@@ -46,7 +46,7 @@
     private CC cc;
     void M()
     {
-        cc.[|StartCoroutine("")|];
+        [|cc.StartCoroutine(""MyCoroutine"")|];
     }
 }";
             Document document;


Fix non-IBeatmap usage

Fix non-IBeatmap usage

--- osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs
+++ osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs
@@ -112,7 +112,7 @@
             AddAssert("check no infolabels", () => !infoWedge.Info.InfoLabelContainer.Children.Any());
         }

-        private void selectBeatmap(Beatmap b)
+        private void selectBeatmap(IBeatmap b)
         {
             BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null;


Fix beatmap lookups failing for beatmaps with no local path

Turns out the underlying EscapeUriString doesn't like nulls

--- osu.Game/Online/API/Requests/GetBeatmapRequest.cs
+++ osu.Game/Online/API/Requests/GetBeatmapRequest.cs
@@ -15,6 +15,6 @@
             this.beatmap = beatmap;
         }

-        protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
+        protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path ?? string.Empty)}";
     }
 }


Fix line endings

Fix line endings

--- osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs
+++ osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs
@@ -1,105 +1,105 @@
-// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
-// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-
-using System;
-using osu.Framework.Allocation;
-using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
-using osu.Framework.Graphics.Primitives;
-using osu.Framework.Graphics.Shapes;
-using osu.Framework.Input;
-using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
-
-namespace osu.Game.Rulesets.Edit.Layers.Selection
-{
-    /// <summary>
-    /// Represents a marker visible on the border of a <see cref="HandleContainer"/> which exposes
-    /// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
-    /// </summary>
-    public class Handle : CompositeDrawable
-    {
-        private const float marker_size = 10;
-
-        /// <summary>
-        /// Invoked when this <see cref="Handle"/> requires the current drag rectangle.
-        /// </summary>
-        public Func<RectangleF> GetDragRectangle;
-
-        /// <summary>
-        /// Invoked when this <see cref="Handle"/> wants to update the drag rectangle.
-        /// </summary>
-        public Action<RectangleF> UpdateDragRectangle;
-
-        /// <summary>
-        /// Invoked when this <see cref="Handle"/> has finished updates to the drag rectangle.
-        /// </summary>
-        public Action FinishDrag;
-
-        private Color4 normalColour;
-        private Color4 hoverColour;
-
-        public Handle()
-        {
-            Size = new Vector2(marker_size);
-
-            InternalChild = new CircularContainer
-            {
-                RelativeSizeAxes = Axes.Both,
-                Masking = true,
-                Child = new Box { RelativeSizeAxes = Axes.Both }
-            };
-        }
-
-        [BackgroundDependencyLoader]
-        private void load(OsuColour colours)
-        {
-            Colour = normalColour = colours.Yellow;
-            hoverColour = colours.YellowDarker;
-        }
-
-        protected override bool OnDragStart(InputState state) => true;
-
-        protected override bool OnDrag(InputState state)
-        {
-            var currentRectangle = GetDragRectangle();
-
-            float left = currentRectangle.Left;
-            float right = currentRectangle.Right;
-            float top = currentRectangle.Top;
-            float bottom = currentRectangle.Bottom;
-
-            // Apply modifications to the capture rectangle
-            if ((Anchor & Anchor.y0) > 0)
-                top += state.Mouse.Delta.Y;
-            else if ((Anchor & Anchor.y2) > 0)
-                bottom += state.Mouse.Delta.Y;
-
-            if ((Anchor & Anchor.x0) > 0)
-                left += state.Mouse.Delta.X;
-            else if ((Anchor & Anchor.x2) > 0)
-                right += state.Mouse.Delta.X;
-
-            UpdateDragRectangle(RectangleF.FromLTRB(left, top, right, bottom));
-            return true;
-        }
-
-        protected override bool OnDragEnd(InputState state)
-        {
-            FinishDrag();
-            return true;
-        }
-
-        protected override bool OnHover(InputState state)
-        {
-            this.FadeColour(hoverColour, 100);
-            return true;
-        }
-
-        protected override void OnHoverLost(InputState state)
-        {
-            this.FadeColour(normalColour, 100);
-        }
-    }
-}
+// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using System;
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Primitives;
+using osu.Framework.Graphics.Shapes;
+using osu.Framework.Input;
+using osu.Game.Graphics;
+using OpenTK;
+using OpenTK.Graphics;
+
+namespace osu.Game.Rulesets.Edit.Layers.Selection
+{
+    /// <summary>
+    /// Represents a marker visible on the border of a <see cref="HandleContainer"/> which exposes
+    /// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
+    /// </summary>
+    public class Handle : CompositeDrawable
+    {
+        private const float marker_size = 10;
+
+        /// <summary>
+        /// Invoked when this <see cref="Handle"/> requires the current drag rectangle.
+        /// </summary>
+        public Func<RectangleF> GetDragRectangle;
+
+        /// <summary>
+        /// Invoked when this <see cref="Handle"/> wants to update the drag rectangle.
+        /// </summary>
+        public Action<RectangleF> UpdateDragRectangle;
+
+        /// <summary>
+        /// Invoked when this <see cref="Handle"/> has finished updates to the drag rectangle.
+        /// </summary>
+        public Action FinishDrag;
+
+        private Color4 normalColour;
+        private Color4 hoverColour;
+
+        public Handle()
+        {
+            Size = new Vector2(marker_size);
+
+            InternalChild = new CircularContainer
+            {
+                RelativeSizeAxes = Axes.Both,
+                Masking = true,
+                Child = new Box { RelativeSizeAxes = Axes.Both }
+            };
+        }
+
+        [BackgroundDependencyLoader]
+        private void load(OsuColour colours)
+        {
+            Colour = normalColour = colours.Yellow;
+            hoverColour = colours.YellowDarker;
+        }
+
+        protected override bool OnDragStart(InputState state) => true;
+
+        protected override bool OnDrag(InputState state)
+        {
+            var currentRectangle = GetDragRectangle();
+
+            float left = currentRectangle.Left;
+            float right = currentRectangle.Right;
+            float top = currentRectangle.Top;
+            float bottom = currentRectangle.Bottom;
+
+            // Apply modifications to the capture rectangle
+            if ((Anchor & Anchor.y0) > 0)
+                top += state.Mouse.Delta.Y;
+            else if ((Anchor & Anchor.y2) > 0)
+                bottom += state.Mouse.Delta.Y;
+
+            if ((Anchor & Anchor.x0) > 0)
+                left += state.Mouse.Delta.X;
+            else if ((Anchor & Anchor.x2) > 0)
+                right += state.Mouse.Delta.X;
+
+            UpdateDragRectangle(RectangleF.FromLTRB(left, top, right, bottom));
+            return true;
+        }
+
+        protected override bool OnDragEnd(InputState state)
+        {
+            FinishDrag();
+            return true;
+        }
+
+        protected override bool OnHover(InputState state)
+        {
+            this.FadeColour(hoverColour, 100);
+            return true;
+        }
+
+        protected override void OnHoverLost(InputState state)
+        {
+            this.FadeColour(normalColour, 100);
+        }
+    }
+}


Added temporary logging.

Added temporary logging.

--- Coderoom.LoadBalancer/DebugConsoleHost.cs
+++ Coderoom.LoadBalancer/DebugConsoleHost.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
+using System.IO;
 using System.Net;

 namespace Coderoom.LoadBalancer
@@ -25,10 +26,17 @@
 			foreach (var contentServer in contentServers)
 				Console.WriteLine("        * {0}:{1}", contentServer.Address, contentServer.Port);

-			var portListener = new PortListener(endPoint);
-			var httpProxy = new HttpProxy(contentServers, portListener);
-			httpProxy.Start();
-			portListener.ConnectionEstablished += (sender, args) => Console.WriteLine("Connection established");
+			try
+			{
+				var portListener = new PortListener(endPoint);
+				var httpProxy = new HttpProxy(contentServers, portListener);
+				httpProxy.Start();
+				portListener.ConnectionEstablished += (sender, args) => Console.WriteLine("Connection established");
+			}
+			catch (Exception ex)
+			{
+				File.WriteAllText("C:\\Deployment\\log.txt", ex.Message + " || " + ex.StackTrace);
+			}

 			Console.WriteLine();
 			Console.WriteLine("Load Balancer started...");


Update Converter.cs

Update Converter.cs

--- svg/Svg.Skia.Converter/Converter.cs
+++ svg/Svg.Skia.Converter/Converter.cs
@@ -94,7 +94,7 @@
                         {
                             throw new ArgumentException($"Invalid output image format.", nameof(format));
                         }
-                    }
+                    }
                 }

                 if (quiet == false)