private static void AssertEvent(EngineerProgressEvent @event) { Assert.NotNull(@event); Assert.Equal(DateTime.Parse("2018-05-04T13:58:22Z"), @event.Timestamp); Assert.Equal(EventName, @event.Event); Assert.Equal(14, @event.Engineers.Length); var engineer = @event.Engineers.Single(e => e.EngineerId == 300200); Assert.Equal("Marco Qwent", engineer.EngineerName); Assert.Equal(EngineerProgressState.Unlocked, engineer.Progress); Assert.Equal(37, engineer.RankProgress); Assert.Equal(4, engineer.Rank); engineer = @event.Engineers.Single(e => e.EngineerId == 300120); Assert.Equal("Lei Cheung", engineer.EngineerName); Assert.Equal(EngineerProgressState.Known, engineer.Progress); Assert.Null(engineer.RankProgress); Assert.Null(engineer.Rank); engineer = @event.Engineers.Single(e => e.EngineerId == 300220); Assert.Equal("Professor Palin", engineer.EngineerName); Assert.Equal(EngineerProgressState.Invited, engineer.Progress); Assert.Null(engineer.RankProgress); Assert.Null(engineer.Rank); }
internal EngineerProgressEvent InvokeEvent(EngineerProgressEvent arg) { if (_api.ValidateEvent(arg)) { EngineerProgress?.Invoke(_api, arg); } return(arg); }
private async void StationOnEngineerProgressAsync(object sender, EngineerProgressEvent e) { if (e?.Engineers == null || e.Engineers.Length == 0) { return; } var request = StartRequest(); foreach (var engineerProgress in e.Engineers) { request.AddCommand(new SetCommanderRankEngineer(engineerProgress.EngineerName, engineerProgress.Progress.ToString()) { RankValue = engineerProgress.Rank }); } await request.SendAsync().ConfigureAwait(false); }
internal void InvokeEngineerProgressEvent(EngineerProgressEvent arg) { EngineerProgressEvent?.Invoke(this, arg); }
internal void InvokeEngineerProgressEvent(EngineerProgressEvent arg) => EngineerProgressEvent?.Invoke(null, arg);