namespace OpenAC.MosswartMassacre.Tests; /// Pins for the fixes a review of the port asked for. public sealed class ReviewFixTests { [Fact] public void On_connect_the_sharing_subscribe_goes_out_before_the_first_telemetry() { using var harness = new PluginHarness("Mossy"); harness.Login(); harness.Context.Settings.Current.VitalSharingEnabled = true; harness.Frames.Clear(); harness.SimulateConnected(); string[] types = [.. harness.Frames.Select(f => (string)Newtonsoft.Json.Linq.JObject.Parse(f)["type"]!)]; Assert.Equal(["share_subscribe", "telemetry"], types.Take(2)); } [Fact] public void A_rare_announcement_still_waiting_at_logoff_is_dropped() { using var harness = new PluginHarness("Mossy"); harness.Login(); harness.Host.Automation.Chat.Deliver("Mossy has discovered the Pearl of Blood Drinking!", kind: 4); harness.Host.Automation.Chat.Submitted.Clear(); harness.Plugin.OnLogoff(); harness.Host.Automation.Character.Name = "Horan"; harness.Plugin.OnLogin(); harness.Host.Automation.Chat.Submitted.Clear(); harness.Run(4); Assert.DoesNotContain(harness.Host.Automation.Chat.Submitted, line => line.StartsWith("/a ", StringComparison.Ordinal)); } }