How to use InitOnEntry method of Microsoft.Coyote.Actors.BugFinding.Tests.Success class

Best Coyote code snippet using Microsoft.Coyote.Actors.BugFinding.Tests.Success.InitOnEntry

ChainReplicationTests.cs

Source:ChainReplicationTests.cs Github

copy

Full Screen

...157 private List<ActorId> Servers;158 private int CheckNodeIdx;159 private int Failures;160 [Start]161 [OnEntry(nameof(InitOnEntry))]162 [OnEventGotoState(typeof(Local), typeof(StartMonitoring))]163 private class Init : State164 {165 }166 private void InitOnEntry(Event e)167 {168 this.Main = (e as SetupEvent).Main;169 this.Servers = (e as SetupEvent).Servers;170 this.CheckNodeIdx = 0;171 this.Failures = 100;172 this.RaiseEvent(new Local());173 }174 [OnEntry(nameof(StartMonitoringOnEntry))]175 [OnEventGotoState(typeof(Pong), typeof(StartMonitoring), nameof(HandlePong))]176 [OnEventGotoState(typeof(InjectFailure), typeof(HandleFailure))]177 private class StartMonitoring : State178 {179 }180 private void StartMonitoringOnEntry()181 {182 if (this.Failures < 1)183 {184 this.RaiseHaltEvent();185 }186 else187 {188 this.SendEvent(this.Servers[this.CheckNodeIdx], new Ping(this.Id));189 if (this.Servers.Count > 1)190 {191 if (this.RandomBoolean())192 {193 this.SendEvent(this.Id, new InjectFailure());194 }195 else196 {197 this.SendEvent(this.Id, new Pong());198 }199 }200 else201 {202 this.SendEvent(this.Id, new Pong());203 }204 this.Failures--;205 }206 }207 private void HandlePong()208 {209 this.CheckNodeIdx++;210 if (this.CheckNodeIdx == this.Servers.Count)211 {212 this.CheckNodeIdx = 0;213 }214 }215 [OnEntry(nameof(HandleFailureOnEntry))]216 [OnEventGotoState(typeof(FailureCorrected), typeof(StartMonitoring), nameof(ProcessFailureCorrected))]217 [IgnoreEvents(typeof(Pong), typeof(InjectFailure))]218 private class HandleFailure : State219 {220 }221 private void HandleFailureOnEntry()222 {223 this.SendEvent(this.Main, new FailureDetected(this.Servers[this.CheckNodeIdx]));224 }225 private void ProcessFailureCorrected(Event e)226 {227 this.CheckNodeIdx = 0;228 this.Servers = (e as FailureCorrected).Servers;229 }230 }231 private class ChainReplicationMaster : StateMachine232 {233 internal class SetupEvent : Event234 {235 public List<ActorId> Servers;236 public List<ActorId> Clients;237 public SetupEvent(List<ActorId> servers, List<ActorId> clients)238 : base()239 {240 this.Servers = servers;241 this.Clients = clients;242 }243 }244 internal class BecomeHead : Event245 {246 public ActorId Target;247 public BecomeHead(ActorId target)248 : base()249 {250 this.Target = target;251 }252 }253 internal class BecomeTail : Event254 {255 public ActorId Target;256 public BecomeTail(ActorId target)257 : base()258 {259 this.Target = target;260 }261 }262 internal class Success : Event263 {264 }265 internal class HeadChanged : Event266 {267 }268 internal class TailChanged : Event269 {270 }271 private class HeadFailed : Event272 {273 }274 private class TailFailed : Event275 {276 }277 private class ServerFailed : Event278 {279 }280 private class FixSuccessor : Event281 {282 }283 private class FixPredecessor : Event284 {285 }286 private class Local : Event287 {288 }289 private class Done : Event290 {291 }292 private List<ActorId> Servers;293 private List<ActorId> Clients;294 private ActorId FailureDetector;295 private ActorId Head;296 private ActorId Tail;297 private int FaultyNodeIndex;298 private int LastUpdateReceivedSucc;299 private int LastAckSent;300 [Start]301 [OnEntry(nameof(InitOnEntry))]302 [OnEventGotoState(typeof(Local), typeof(WaitForFailure))]303 private class Init : State304 {305 }306 private void InitOnEntry(Event e)307 {308 this.Servers = (e as SetupEvent).Servers;309 this.Clients = (e as SetupEvent).Clients;310 this.FailureDetector = this.CreateActor(311 typeof(FailureDetector),312 new FailureDetector.SetupEvent(this.Id, this.Servers));313 this.Head = this.Servers[0];314 this.Tail = this.Servers[this.Servers.Count - 1];315 this.RaiseEvent(new Local());316 }317 [OnEventGotoState(typeof(HeadFailed), typeof(CorrectHeadFailure))]318 [OnEventGotoState(typeof(TailFailed), typeof(CorrectTailFailure))]319 [OnEventGotoState(typeof(ServerFailed), typeof(CorrectServerFailure))]320 [OnEventDoAction(typeof(FailureDetector.FailureDetected), nameof(CheckWhichNodeFailed))]321 private class WaitForFailure : State322 {323 }324 private void CheckWhichNodeFailed(Event e)325 {326 this.Assert(this.Servers.Count > 1, "All nodes have failed.");327 var failedServer = (e as FailureDetector.FailureDetected).Server;328 if (this.Head.Equals(failedServer))329 {330 this.RaiseEvent(new HeadFailed());331 }332 else if (this.Tail.Equals(failedServer))333 {334 this.RaiseEvent(new TailFailed());335 }336 else337 {338 for (int i = 0; i < this.Servers.Count - 1; i++)339 {340 if (this.Servers[i].Equals(failedServer))341 {342 this.FaultyNodeIndex = i;343 }344 }345 this.RaiseEvent(new ServerFailed());346 }347 }348 [OnEntry(nameof(CorrectHeadFailureOnEntry))]349 [OnEventGotoState(typeof(Done), typeof(WaitForFailure), nameof(UpdateFailureDetector))]350 [OnEventDoAction(typeof(HeadChanged), nameof(UpdateClients))]351 private class CorrectHeadFailure : State352 {353 }354 private void CorrectHeadFailureOnEntry()355 {356 this.Servers.RemoveAt(0);357 this.Monitor<InvariantMonitor>(358 new InvariantMonitor.UpdateServers(this.Servers));359 this.Monitor<ServerResponseSeqMonitor>(360 new ServerResponseSeqMonitor.UpdateServers(this.Servers));361 this.Head = this.Servers[0];362 this.SendEvent(this.Head, new BecomeHead(this.Id));363 }364 private void UpdateClients()365 {366 for (int i = 0; i < this.Clients.Count; i++)367 {368 this.SendEvent(this.Clients[i], new Client.UpdateHeadTail(this.Head, this.Tail));369 }370 this.RaiseEvent(new Done());371 }372 private void UpdateFailureDetector()373 {374 this.SendEvent(this.FailureDetector, new FailureDetector.FailureCorrected(this.Servers));375 }376 [OnEntry(nameof(CorrectTailFailureOnEntry))]377 [OnEventGotoState(typeof(Done), typeof(WaitForFailure), nameof(UpdateFailureDetector))]378 [OnEventDoAction(typeof(TailChanged), nameof(UpdateClients))]379 private class CorrectTailFailure : State380 {381 }382 private void CorrectTailFailureOnEntry()383 {384 this.Servers.RemoveAt(this.Servers.Count - 1);385 this.Monitor<InvariantMonitor>(386 new InvariantMonitor.UpdateServers(this.Servers));387 this.Monitor<ServerResponseSeqMonitor>(388 new ServerResponseSeqMonitor.UpdateServers(this.Servers));389 this.Tail = this.Servers[this.Servers.Count - 1];390 this.SendEvent(this.Tail, new BecomeTail(this.Id));391 }392 [OnEntry(nameof(CorrectServerFailureOnEntry))]393 [OnEventGotoState(typeof(Done), typeof(WaitForFailure), nameof(UpdateFailureDetector))]394 [OnEventDoAction(typeof(FixSuccessor), nameof(UpdateClients))]395 [OnEventDoAction(typeof(FixPredecessor), nameof(ProcessFixPredecessor))]396 [OnEventDoAction(typeof(ChainReplicationServer.NewSuccInfo), nameof(SetLastUpdate))]397 [OnEventDoAction(typeof(Success), nameof(ProcessSuccess))]398 private class CorrectServerFailure : State399 {400 }401 private void CorrectServerFailureOnEntry()402 {403 this.Servers.RemoveAt(this.FaultyNodeIndex);404 this.Monitor<InvariantMonitor>(405 new InvariantMonitor.UpdateServers(this.Servers));406 this.Monitor<ServerResponseSeqMonitor>(407 new ServerResponseSeqMonitor.UpdateServers(this.Servers));408 this.RaiseEvent(new FixSuccessor());409 }410 private void ProcessFixPredecessor()411 {412 this.SendEvent(this.Servers[this.FaultyNodeIndex - 1], new ChainReplicationServer.NewSuccessor(413 this.Id, this.Servers[this.FaultyNodeIndex], this.LastAckSent, this.LastUpdateReceivedSucc));414 }415 private void SetLastUpdate(Event e)416 {417 this.LastUpdateReceivedSucc = (e as418 ChainReplicationServer.NewSuccInfo).LastUpdateReceivedSucc;419 this.LastAckSent = (e as420 ChainReplicationServer.NewSuccInfo).LastAckSent;421 this.RaiseEvent(new FixPredecessor());422 }423 private void ProcessSuccess() => this.RaiseEvent(new Done());424 }425 private class ChainReplicationServer : StateMachine426 {427 internal class SetupEvent : Event428 {429 public int Id;430 public bool IsHead;431 public bool IsTail;432 public SetupEvent(int id, bool isHead, bool isTail)433 : base()434 {435 this.Id = id;436 this.IsHead = isHead;437 this.IsTail = isTail;438 }439 }440 internal class PredSucc : Event441 {442 public ActorId Predecessor;443 public ActorId Successor;444 public PredSucc(ActorId pred, ActorId succ)445 : base()446 {447 this.Predecessor = pred;448 this.Successor = succ;449 }450 }451 internal class ForwardUpdate : Event452 {453 public ActorId Predecessor;454 public int NextSeqId;455 public ActorId Client;456 public int Key;457 public int Value;458 public ForwardUpdate(ActorId pred, int nextSeqId, ActorId client, int key, int val)459 : base()460 {461 this.Predecessor = pred;462 this.NextSeqId = nextSeqId;463 this.Client = client;464 this.Key = key;465 this.Value = val;466 }467 }468 internal class BackwardAck : Event469 {470 public int NextSeqId;471 public BackwardAck(int nextSeqId)472 : base()473 {474 this.NextSeqId = nextSeqId;475 }476 }477 internal class NewPredecessor : Event478 {479 public ActorId Main;480 public ActorId Predecessor;481 public NewPredecessor(ActorId main, ActorId pred)482 : base()483 {484 this.Main = main;485 this.Predecessor = pred;486 }487 }488 internal class NewSuccessor : Event489 {490 public ActorId Main;491 public ActorId Successor;492 public int LastUpdateReceivedSucc;493 public int LastAckSent;494 public NewSuccessor(ActorId main, ActorId succ,495 int lastUpdateReceivedSucc, int lastAckSent)496 : base()497 {498 this.Main = main;499 this.Successor = succ;500 this.LastUpdateReceivedSucc = lastUpdateReceivedSucc;501 this.LastAckSent = lastAckSent;502 }503 }504 internal class NewSuccInfo : Event505 {506 public int LastUpdateReceivedSucc;507 public int LastAckSent;508 public NewSuccInfo(int lastUpdateReceivedSucc, int lastAckSent)509 : base()510 {511 this.LastUpdateReceivedSucc = lastUpdateReceivedSucc;512 this.LastAckSent = lastAckSent;513 }514 }515 internal class ResponseToQuery : Event516 {517 public int Value;518 public ResponseToQuery(int val)519 : base()520 {521 this.Value = val;522 }523 }524 internal class ResponseToUpdate : Event525 {526 }527 private class Local : Event528 {529 }530 private int ServerId;531 private bool IsHead;532 private bool IsTail;533 private ActorId Predecessor;534 private ActorId Successor;535 private Dictionary<int, int> KeyValueStore;536 private List<int> History;537 private List<SentLog> SentHistory;538 private int NextSeqId;539 [Start]540 [OnEntry(nameof(InitOnEntry))]541 [OnEventGotoState(typeof(Local), typeof(WaitForRequest))]542 [OnEventDoAction(typeof(PredSucc), nameof(SetupPredSucc))]543 [DeferEvents(typeof(Client.Update), typeof(Client.Query),544 typeof(BackwardAck), typeof(ForwardUpdate))]545 private class Init : State546 {547 }548 private void InitOnEntry(Event e)549 {550 this.ServerId = (e as SetupEvent).Id;551 this.IsHead = (e as SetupEvent).IsHead;552 this.IsTail = (e as SetupEvent).IsTail;553 this.KeyValueStore = new Dictionary<int, int>();554 this.History = new List<int>();555 this.SentHistory = new List<SentLog>();556 this.NextSeqId = 0;557 }558 private void SetupPredSucc(Event e)559 {560 this.Predecessor = (e as PredSucc).Predecessor;561 this.Successor = (e as PredSucc).Successor;562 this.RaiseEvent(new Local());563 }564 [OnEventGotoState(typeof(Client.Update), typeof(ProcessUpdate), nameof(ProcessUpdateAction))]565 [OnEventGotoState(typeof(ForwardUpdate), typeof(ProcessFwdUpdate))]566 [OnEventGotoState(typeof(BackwardAck), typeof(ProcessBckAck))]567 [OnEventDoAction(typeof(Client.Query), nameof(ProcessQueryAction))]568 [OnEventDoAction(typeof(NewPredecessor), nameof(UpdatePredecessor))]569 [OnEventDoAction(typeof(NewSuccessor), nameof(UpdateSuccessor))]570 [OnEventDoAction(typeof(ChainReplicationMaster.BecomeHead), nameof(ProcessBecomeHead))]571 [OnEventDoAction(typeof(ChainReplicationMaster.BecomeTail), nameof(ProcessBecomeTail))]572 [OnEventDoAction(typeof(FailureDetector.Ping), nameof(SendPong))]573 private class WaitForRequest : State574 {575 }576 private void ProcessUpdateAction()577 {578 this.NextSeqId++;579 this.Assert(this.IsHead, "Server {0} is not head", this.ServerId);580 }581 private void ProcessQueryAction(Event e)582 {583 var client = (e as Client.Query).Client;584 var key = (e as Client.Query).Key;585 this.Assert(this.IsTail, "Server {0} is not tail", this.Id);586 if (this.KeyValueStore.ContainsKey(key))587 {588 this.Monitor<ServerResponseSeqMonitor>(new ServerResponseSeqMonitor.ResponseToQuery(589 this.Id, key, this.KeyValueStore[key]));590 this.SendEvent(client, new ResponseToQuery(this.KeyValueStore[key]));591 }592 else593 {594 this.SendEvent(client, new ResponseToQuery(-1));595 }596 }597 private void ProcessBecomeHead(Event e)598 {599 this.IsHead = true;600 this.Predecessor = this.Id;601 var target = (e as ChainReplicationMaster.BecomeHead).Target;602 this.SendEvent(target, new ChainReplicationMaster.HeadChanged());603 }604 private void ProcessBecomeTail(Event e)605 {606 this.IsTail = true;607 this.Successor = this.Id;608 for (int i = 0; i < this.SentHistory.Count; i++)609 {610 this.Monitor<ServerResponseSeqMonitor>(new ServerResponseSeqMonitor.ResponseToUpdate(611 this.Id, this.SentHistory[i].Key, this.SentHistory[i].Value));612 this.SendEvent(this.SentHistory[i].Client, new ResponseToUpdate());613 this.SendEvent(this.Predecessor, new BackwardAck(this.SentHistory[i].NextSeqId));614 }615 var target = (e as ChainReplicationMaster.BecomeTail).Target;616 this.SendEvent(target, new ChainReplicationMaster.TailChanged());617 }618 private void SendPong(Event e)619 {620 var target = (e as FailureDetector.Ping).Target;621 this.SendEvent(target, new FailureDetector.Pong());622 }623 private void UpdatePredecessor(Event e)624 {625 var main = (e as NewPredecessor).Main;626 this.Predecessor = (e as NewPredecessor).Predecessor;627 if (this.History.Count > 0)628 {629 if (this.SentHistory.Count > 0)630 {631 this.SendEvent(main, new NewSuccInfo(632 this.History[this.History.Count - 1],633 this.SentHistory[0].NextSeqId));634 }635 else636 {637 this.SendEvent(main, new NewSuccInfo(638 this.History[this.History.Count - 1],639 this.History[this.History.Count - 1]));640 }641 }642 }643 private void UpdateSuccessor(Event e)644 {645 var main = (e as NewSuccessor).Main;646 this.Successor = (e as NewSuccessor).Successor;647 var lastUpdateReceivedSucc = (e as NewSuccessor).LastUpdateReceivedSucc;648 var lastAckSent = (e as NewSuccessor).LastAckSent;649 if (this.SentHistory.Count > 0)650 {651 for (int i = 0; i < this.SentHistory.Count; i++)652 {653 if (this.SentHistory[i].NextSeqId > lastUpdateReceivedSucc)654 {655 this.SendEvent(this.Successor, new ForwardUpdate(this.Id, this.SentHistory[i].NextSeqId,656 this.SentHistory[i].Client, this.SentHistory[i].Key, this.SentHistory[i].Value));657 }658 }659 int tempIndex = -1;660 for (int i = this.SentHistory.Count - 1; i >= 0; i--)661 {662 if (this.SentHistory[i].NextSeqId == lastAckSent)663 {664 tempIndex = i;665 }666 }667 for (int i = 0; i < tempIndex; i++)668 {669 this.SendEvent(this.Predecessor, new BackwardAck(this.SentHistory[0].NextSeqId));670 this.SentHistory.RemoveAt(0);671 }672 }673 this.SendEvent(main, new ChainReplicationMaster.Success());674 }675 [OnEntry(nameof(ProcessUpdateOnEntry))]676 [OnEventGotoState(typeof(Local), typeof(WaitForRequest))]677 private class ProcessUpdate : State678 {679 }680 private void ProcessUpdateOnEntry(Event e)681 {682 var client = (e as Client.Update).Client;683 var key = (e as Client.Update).Key;684 var value = (e as Client.Update).Value;685 if (this.KeyValueStore.ContainsKey(key))686 {687 this.KeyValueStore[key] = value;688 }689 else690 {691 this.KeyValueStore.Add(key, value);692 }693 this.History.Add(this.NextSeqId);694 this.Monitor<InvariantMonitor>(695 new InvariantMonitor.HistoryUpdate(this.Id, new List<int>(this.History)));696 this.SentHistory.Add(new SentLog(this.NextSeqId, client, key, value));697 this.Monitor<InvariantMonitor>(698 new InvariantMonitor.SentUpdate(this.Id, new List<SentLog>(this.SentHistory)));699 this.SendEvent(this.Successor, new ForwardUpdate(this.Id, this.NextSeqId, client, key, value));700 this.RaiseEvent(new Local());701 }702 [OnEntry(nameof(ProcessFwdUpdateOnEntry))]703 [OnEventGotoState(typeof(Local), typeof(WaitForRequest))]704 private class ProcessFwdUpdate : State705 {706 }707 private void ProcessFwdUpdateOnEntry(Event e)708 {709 var pred = (e as ForwardUpdate).Predecessor;710 var nextSeqId = (e as ForwardUpdate).NextSeqId;711 var client = (e as ForwardUpdate).Client;712 var key = (e as ForwardUpdate).Key;713 var value = (e as ForwardUpdate).Value;714 if (pred.Equals(this.Predecessor))715 {716 this.NextSeqId = nextSeqId;717 if (this.KeyValueStore.ContainsKey(key))718 {719 this.KeyValueStore[key] = value;720 }721 else722 {723 this.KeyValueStore.Add(key, value);724 }725 if (!this.IsTail)726 {727 this.History.Add(nextSeqId);728 this.Monitor<InvariantMonitor>(729 new InvariantMonitor.HistoryUpdate(this.Id, new List<int>(this.History)));730 this.SentHistory.Add(new SentLog(this.NextSeqId, client, key, value));731 this.Monitor<InvariantMonitor>(732 new InvariantMonitor.SentUpdate(this.Id, new List<SentLog>(this.SentHistory)));733 this.SendEvent(this.Successor, new ForwardUpdate(this.Id, this.NextSeqId, client, key, value));734 }735 else736 {737 if (!this.IsHead)738 {739 this.History.Add(nextSeqId);740 }741 this.Monitor<ServerResponseSeqMonitor>(new ServerResponseSeqMonitor.ResponseToUpdate(742 this.Id, key, value));743 this.SendEvent(client, new ResponseToUpdate());744 this.SendEvent(this.Predecessor, new BackwardAck(nextSeqId));745 }746 }747 this.RaiseEvent(new Local());748 }749 [OnEntry(nameof(ProcessBckAckOnEntry))]750 [OnEventGotoState(typeof(Local), typeof(WaitForRequest))]751 private class ProcessBckAck : State752 {753 }754 private void ProcessBckAckOnEntry(Event e)755 {756 var nextSeqId = (e as BackwardAck).NextSeqId;757 this.RemoveItemFromSent(nextSeqId);758 if (!this.IsHead)759 {760 this.SendEvent(this.Predecessor, new BackwardAck(nextSeqId));761 }762 this.RaiseEvent(new Local());763 }764 private void RemoveItemFromSent(int seqId)765 {766 int removeIdx = -1;767 for (int i = this.SentHistory.Count - 1; i >= 0; i--)768 {769 if (seqId == this.SentHistory[i].NextSeqId)770 {771 removeIdx = i;772 }773 }774 if (removeIdx != -1)775 {776 this.SentHistory.RemoveAt(removeIdx);777 }778 }779 }780 private class Client : StateMachine781 {782 internal class SetupEvent : Event783 {784 public int Id;785 public ActorId HeadNode;786 public ActorId TailNode;787 public int Value;788 public SetupEvent(int id, ActorId head, ActorId tail, int val)789 : base()790 {791 this.Id = id;792 this.HeadNode = head;793 this.TailNode = tail;794 this.Value = val;795 }796 }797 internal class UpdateHeadTail : Event798 {799 public ActorId Head;800 public ActorId Tail;801 public UpdateHeadTail(ActorId head, ActorId tail)802 : base()803 {804 this.Head = head;805 this.Tail = tail;806 }807 }808 internal class Update : Event809 {810 public ActorId Client;811 public int Key;812 public int Value;813 public Update(ActorId client, int key, int value)814 : base()815 {816 this.Client = client;817 this.Key = key;818 this.Value = value;819 }820 }821 internal class Query : Event822 {823 public ActorId Client;824 public int Key;825 public Query(ActorId client, int key)826 : base()827 {828 this.Client = client;829 this.Key = key;830 }831 }832 private class Local : Event833 {834 }835 private class Done : Event836 {837 }838 private ActorId HeadNode;839 private ActorId TailNode;840 private int StartIn;841 private int Next;842 private Dictionary<int, int> KeyValueStore;843 [Start]844 [OnEntry(nameof(InitOnEntry))]845 [OnEventGotoState(typeof(Local), typeof(PumpUpdateRequests))]846 private class Init : State847 {848 }849 private void InitOnEntry(Event e)850 {851 this.HeadNode = (e as SetupEvent).HeadNode;852 this.TailNode = (e as SetupEvent).TailNode;853 this.StartIn = (e as SetupEvent).Value;854 this.Next = 1;855 this.KeyValueStore = new Dictionary<int, int>856 {857 { 1 * this.StartIn, 100 },858 { 2 * this.StartIn, 200 },859 { 3 * this.StartIn, 300 },860 { 4 * this.StartIn, 400 }861 };862 this.RaiseEvent(new Local());863 }...

Full Screen

Full Screen

RaftTests.cs

Source:RaftTests.cs Github

copy

Full Screen

...824 private ActorId Cluster;825 private int LatestCommand;826 private int Counter;827 [Start]828 [OnEntry(nameof(InitOnEntry))]829 [OnEventDoAction(typeof(ConfigureEvent), nameof(SetupEvent))]830 [OnEventGotoState(typeof(LocalEvent), typeof(PumpRequest))]831 private class Init : State832 {833 }834 private void InitOnEntry()835 {836 this.LatestCommand = -1;837 this.Counter = 0;838 }839 private void SetupEvent(Event e)840 {841 this.Cluster = (e as ConfigureEvent).Cluster;842 this.RaiseEvent(new LocalEvent());843 }844 [OnEntry(nameof(PumpRequestOnEntry))]845 [OnEventDoAction(typeof(Response), nameof(ProcessResponse))]846 [OnEventGotoState(typeof(LocalEvent), typeof(PumpRequest))]847 private class PumpRequest : State848 {849 }850 private void PumpRequestOnEntry()851 {852 this.LatestCommand = this.RandomInteger(100);853 this.Counter++;854 this.SendEvent(this.Cluster, new Request(this.Id, this.LatestCommand));855 }856 private void ProcessResponse()857 {858 if (this.Counter is 3)859 {860 this.SendEvent(this.Cluster, new ClusterManager.ShutDown());861 this.RaiseHaltEvent();862 }863 else864 {865 this.RaiseEvent(new LocalEvent());866 }867 }868 }869 private class ElectionTimer : StateMachine870 {871 internal class ConfigureEvent : Event872 {873 public ActorId Target;874 public ConfigureEvent(ActorId id)875 : base()876 {877 this.Target = id;878 }879 }880 internal class StartTimerEvent : Event881 {882 }883 internal class CancelTimer : Event884 {885 }886 internal class Timeout : Event887 {888 }889 private class TickEvent : Event890 {891 }892 private ActorId Target;893 [Start]894 [OnEventDoAction(typeof(ConfigureEvent), nameof(SetupEvent))]895 [OnEventGotoState(typeof(StartTimerEvent), typeof(Active))]896 private class Init : State897 {898 }899 private void SetupEvent(Event e)900 {901 this.Target = (e as ConfigureEvent).Target;902 }903 [OnEntry(nameof(ActiveOnEntry))]904 [OnEventDoAction(typeof(TickEvent), nameof(Tick))]905 [OnEventGotoState(typeof(CancelTimer), typeof(Inactive))]906 [IgnoreEvents(typeof(StartTimerEvent))]907 private class Active : State908 {909 }910 private void ActiveOnEntry()911 {912 this.SendEvent(this.Id, new TickEvent());913 }914 private void Tick()915 {916 if (this.RandomBoolean())917 {918 this.SendEvent(this.Target, new Timeout());919 }920 this.RaiseEvent(new CancelTimer());921 }922 [OnEventGotoState(typeof(StartTimerEvent), typeof(Active))]923 [IgnoreEvents(typeof(CancelTimer), typeof(TickEvent))]924 private class Inactive : State925 {926 }927 }928 private class PeriodicTimer : StateMachine929 {930 internal class ConfigureEvent : Event931 {932 public ActorId Target;933 public ConfigureEvent(ActorId id)934 : base()935 {936 this.Target = id;937 }938 }939 internal class StartTimerEvent : Event940 {941 }942 internal class CancelTimer : Event943 {944 }945 internal class Timeout : Event946 {947 }948 private class TickEvent : Event949 {950 }951 private ActorId Target;952 [Start]953 [OnEventDoAction(typeof(ConfigureEvent), nameof(SetupEvent))]954 [OnEventGotoState(typeof(StartTimerEvent), typeof(Active))]955 private class Init : State956 {957 }958 private void SetupEvent(Event e)959 {960 this.Target = (e as ConfigureEvent).Target;961 }962 [OnEntry(nameof(ActiveOnEntry))]963 [OnEventDoAction(typeof(TickEvent), nameof(Tick))]964 [OnEventGotoState(typeof(CancelTimer), typeof(Inactive))]965 [IgnoreEvents(typeof(StartTimerEvent))]966 private class Active : State967 {968 }969 private void ActiveOnEntry()970 {971 this.SendEvent(this.Id, new TickEvent());972 }973 private void Tick()974 {975 if (this.RandomBoolean())976 {977 this.SendEvent(this.Target, new Timeout());978 }979 this.RaiseEvent(new CancelTimer());980 }981 [OnEventGotoState(typeof(StartTimerEvent), typeof(Active))]982 [IgnoreEvents(typeof(CancelTimer), typeof(TickEvent))]983 private class Inactive : State984 {985 }986 }987 private class SafetyMonitor : Monitor988 {989 internal class NotifyLeaderElected : Event990 {991 public int Term;992 public NotifyLeaderElected(int term)993 : base()994 {995 this.Term = term;996 }997 }998 private class LocalEvent : Event999 {1000 }1001 private HashSet<int> TermsWithLeader;1002 [Start]1003 [OnEntry(nameof(InitOnEntry))]1004 [OnEventGotoState(typeof(LocalEvent), typeof(Monitoring))]1005 private class Init : State1006 {1007 }1008 private void InitOnEntry()1009 {1010 this.TermsWithLeader = new HashSet<int>();1011 this.RaiseEvent(new LocalEvent());1012 }1013 [OnEventDoAction(typeof(NotifyLeaderElected), nameof(ProcessLeaderElected))]1014 private class Monitoring : State1015 {1016 }1017 private void ProcessLeaderElected(Event e)1018 {1019 var term = (e as NotifyLeaderElected).Term;1020 this.Assert(!this.TermsWithLeader.Contains(term), $"Detected more than one leader.");1021 this.TermsWithLeader.Add(term);1022 }...

Full Screen

Full Screen

TwoActorIntegrationTests.cs

Source:TwoActorIntegrationTests.cs Github

copy

Full Screen

...43 {44 private bool Test = false;45 private ActorId TargetId;46 [Start]47 [OnEntry(nameof(InitOnEntry))]48 [OnExit(nameof(InitOnExit))]49 [OnEventGotoState(typeof(DefaultEvent), typeof(S1))]50 [OnEventDoAction(typeof(E1), nameof(Action1))]51 private class Init : State52 {53 }54 private void InitOnEntry()55 {56 this.TargetId = this.CreateActor(typeof(M1b));57 this.RaiseEvent(new E1());58 }59 private void InitOnExit()60 {61 this.SendEvent(this.TargetId, new E3(this.Test), options: new SendOptions(assert: 1));62 }63 private class S1 : State64 {65 }66 private void Action1()67 {68 this.Test = true;69 }70 }71 [OnEventDoAction(typeof(E3), nameof(EntryAction))]72 private class M1b : Actor73 {74 private void EntryAction(Event e)75 {76 if (e.GetType() == typeof(E3))77 {78 this.Action2(e);79 }80 }81 private void Action2(Event e)82 {83 this.Assert((e as E3).Value is false, "Reached test assertion.");84 }85 }86 [Fact(Timeout = 5000)]87 public void TestTwoActorIntegration1()88 {89 this.TestWithError(r =>90 {91 r.CreateActor(typeof(M1a));92 },93 configuration: this.GetConfiguration().WithTestingIterations(100),94 expectedError: "Reached test assertion.",95 replay: true);96 }97 private class M2a : StateMachine98 {99 private ActorId TargetId;100 private int Count;101 [Start]102 [OnEntry(nameof(InitOnEntry))]103 [OnEventGotoState(typeof(SuccessE), typeof(Active))]104 private class Init : State105 {106 }107 private void InitOnEntry()108 {109 this.TargetId = this.CreateActor(typeof(M2b));110 this.RaiseEvent(new SuccessE());111 }112 [OnEntry(nameof(ActiveOnEntry))]113 [OnEventGotoState(typeof(SuccessE), typeof(WaitEvent))]114 private class Active : State115 {116 }117 private void ActiveOnEntry()118 {119 this.Count += 1;120 if (this.Count is 1)121 {122 this.SendEvent(this.TargetId, new E4(this.Id), options: new SendOptions(assert: 1));123 }124 if (this.Count is 2)125 {126 this.SendEvent(this.TargetId, new IgnoredE());127 }128 this.RaiseEvent(new SuccessE());129 }130 [OnEventGotoState(typeof(E1), typeof(Active))]131 private class WaitEvent : State132 {133 }134 private class Done : State135 {136 }137 }138 private class M2b : StateMachine139 {140 [Start]141 [OnEventGotoState(typeof(E4), typeof(Active))]142 [OnEventDoAction(typeof(IgnoredE), nameof(Action1))]143 private class Waiting : State144 {145 }146 private void Action1()147 {148 this.Assert(false, "Reached test assertion.");149 }150 [OnEntry(nameof(ActiveOnEntry))]151 [OnEventGotoState(typeof(SuccessE), typeof(Waiting))]152 private class Active : State153 {154 }155 private void ActiveOnEntry(Event e)156 {157 this.SendEvent((e as E4).Id, new E1(), options: new SendOptions(assert: 1));158 this.RaiseEvent(new SuccessE());159 }160 }161 [Fact(Timeout = 5000)]162 public void TestTwoActorIntegration2()163 {164 this.TestWithError(r =>165 {166 r.CreateActor(typeof(M2a));167 },168 configuration: this.GetConfiguration().WithTestingIterations(100),169 expectedError: "Reached test assertion.",170 replay: true);171 }172 private class M3a : StateMachine173 {174 private ActorId TargetId;175 private int Count;176 [Start]177 [OnEntry(nameof(InitOnEntry))]178 [OnEventGotoState(typeof(SuccessE), typeof(Active))]179 private class Init : State180 {181 }182 private void InitOnEntry()183 {184 this.TargetId = this.CreateActor(typeof(M3b));185 this.RaiseEvent(new SuccessE());186 }187 [OnEntry(nameof(ActiveOnEntry))]188 [OnEventGotoState(typeof(SuccessE), typeof(WaitEvent))]189 private class Active : State190 {191 }192 private void ActiveOnEntry()193 {194 this.Count += 1;195 if (this.Count is 1)196 {197 this.SendEvent(this.TargetId, new E4(this.Id), options: new SendOptions(assert: 1));198 }199 if (this.Count is 2)200 {201 this.SendEvent(this.TargetId, HaltEvent.Instance);202 this.SendEvent(this.TargetId, new IgnoredE());203 }204 this.RaiseEvent(new SuccessE());205 }206 [OnEventGotoState(typeof(E1), typeof(Active))]207 private class WaitEvent : State208 {209 }210 private class Done : State211 {212 }213 }214 private class M3b : StateMachine215 {216 [Start]217 [OnEventGotoState(typeof(E4), typeof(Active))]218 [OnEventGotoState(typeof(HaltEvent), typeof(Inactive))]219 private class Waiting : State220 {221 }222 [OnEntry(nameof(ActiveOnEntry))]223 [OnEventGotoState(typeof(SuccessE), typeof(Waiting))]224 private class Active : State225 {226 }227 private void ActiveOnEntry(Event e)228 {229 this.SendEvent((e as E4).Id, new E1(), options: new SendOptions(assert: 1));230 this.RaiseEvent(new SuccessE());231 }232 [OnEventDoAction(typeof(IgnoredE), nameof(Action1))]233 [IgnoreEvents(typeof(E4))]234 private class Inactive : State235 {236 }237 private void Action1()238 {239 this.Assert(false, "Reached test assertion.");240 }241 }242 [Fact(Timeout = 5000)]243 public void TestTwoActorIntegration3()244 {245 this.TestWithError(r =>246 {247 r.CreateActor(typeof(M3a));248 },249 configuration: this.GetConfiguration().WithTestingIterations(100),250 expectedError: "Reached test assertion.",251 replay: true);252 }253 private class M4a : StateMachine254 {255 private ActorId TargetId;256 [Start]257 [OnEntry(nameof(InitOnEntry))]258 [OnEventGotoState(typeof(SuccessE), typeof(Active))]259 private class Init : State260 {261 }262 private void InitOnEntry()263 {264 this.TargetId = this.CreateActor(typeof(M4b));265 this.RaiseEvent(new SuccessE());266 }267 [OnEntry(nameof(ActiveOnEntry))]268 [OnEventGotoState(typeof(SuccessE), typeof(Waiting))]269 private class Active : State270 {271 }272 private void ActiveOnEntry()273 {274 this.SendEvent(this.TargetId, new E4(this.Id), options: new SendOptions(assert: 1));275 this.RaiseEvent(new SuccessE());276 }277 [OnEventGotoState(typeof(E1), typeof(Active))]278 private class Waiting : State279 {280 }281 }282 private class M4b : StateMachine283 {284 private int Count = 0;285 [Start]286 [OnEventGotoState(typeof(E4), typeof(Active))]287 private class Waiting : State288 {289 }290 [OnEntry(nameof(ActiveOnEntry))]291 [OnEventGotoState(typeof(SuccessE), typeof(Waiting))]292 private class Active : State293 {294 }295 private void ActiveOnEntry(Event e)296 {297 this.Count++;298 if (this.Count is 1)299 {300 this.SendEvent((e as E4).Id, new E1(), options: new SendOptions(assert: 1));301 }302 else if (this.Count is 2)303 {304 this.SendEvent((e as E4).Id, new E1(), options: new SendOptions(assert: 1));305 this.RaiseHaltEvent();306 return;307 }308 this.RaiseEvent(new SuccessE());309 }310 protected override Task OnHaltAsync(Event e)311 {312 this.Assert(false, "Reached test assertion.");313 return Task.CompletedTask;314 }315 }316 [Fact(Timeout = 5000)]317 public void TestTwoActorIntegration4()318 {319 this.TestWithError(r =>320 {321 r.CreateActor(typeof(M4a));322 },323 configuration: this.GetConfiguration().WithTestingIterations(100),324 expectedError: "Reached test assertion.",325 replay: true);326 }327 private class M5a : StateMachine328 {329 private ActorId TargetId;330 [Start]331 [OnEntry(nameof(InitOnEntry))]332 [OnExit(nameof(InitOnExit))]333 [OnEventGotoState(typeof(E1), typeof(Active))]334 private class Init : State335 {336 }337 private void InitOnEntry() => this.RaiseEvent(new E1());338 private void InitOnExit()339 {340 this.TargetId = this.CreateActor(typeof(M5b));341 this.SendEvent(this.TargetId, new E1(), options: new SendOptions(assert: 1));342 }343 [OnEntry(nameof(ActiveOnEntry))]344 private class Active : State345 {346 }347 private void ActiveOnEntry()348 {349 this.SendEvent(this.TargetId, new E2(), options: new SendOptions(assert: 1));350 }351 }...

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using Microsoft.Coyote.Actors;2using Microsoft.Coyote.Actors.BugFinding.Tests;3using System.Threading.Tasks;4{5 {6 static async Task Main(string[] args)7 {8 var config = Configuration.Create().WithVerbosityEnabled();9 using (var runtime = RuntimeFactory.Create(config))10 {11 await runtime.CreateActorAsync(typeof(Success));12 }13 }14 }15}16using Microsoft.Coyote.Actors;17using Microsoft.Coyote.Actors.BugFinding.Tests;18using System.Threading.Tasks;19{20 {21 static async Task Main(string[] args)22 {23 var config = Configuration.Create().WithVerbosityEnabled();24 using (var runtime = RuntimeFactory.Create(config))25 {26 await runtime.CreateActorAsync(typeof(Faulty));27 }28 }29 }30}31using Microsoft.Coyote.Actors;32using Microsoft.Coyote.Actors.BugFinding.Tests;33using System.Threading.Tasks;34{35 {36 static async Task Main(string[] args)37 {38 var config = Configuration.Create().WithVerbosityEnabled();39 using (var runtime = RuntimeFactory.Create(config))40 {41 await runtime.CreateActorAsync(typeof(SelfLoop));42 }43 }44 }45}46using Microsoft.Coyote.Actors;47using Microsoft.Coyote.Actors.BugFinding.Tests;48using System.Threading.Tasks;49{50 {51 static async Task Main(string[] args)52 {53 var config = Configuration.Create().WithVerbosityEnabled();54 using (var runtime = RuntimeFactory.Create(config))55 {56 await runtime.CreateActorAsync(typeof(SelfLoop2));57 }58 }59 }60}61using Microsoft.Coyote.Actors;

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using Microsoft.Coyote.Actors;2using Microsoft.Coyote.Actors.BugFinding.Tests;3{4 {5 [OnEntry(nameof(InitOnEntry))]6 [OnEventGotoState(typeof(UnitEvent), typeof(Init))]7 {8 }9 void InitOnEntry()10 {11 }12 }13}14using Microsoft.Coyote.Actors;15using Microsoft.Coyote.Actors.BugFinding.Tests;16{17 {18 [OnEntry(nameof(InitOnEntry))]19 [OnEventGotoState(typeof(UnitEvent), typeof(Init))]20 {21 }22 void InitOnEntry()23 {24 }25 }26}27using Microsoft.Coyote.Actors;28using Microsoft.Coyote.Actors.BugFinding.Tests;29{30 {31 [OnEntry(nameof(InitOnEntry))]32 [OnEventGotoState(typeof(UnitEvent), typeof(Init))]33 {34 }35 void InitOnEntry()36 {37 }38 }39}40using Microsoft.Coyote.Actors;41using Microsoft.Coyote.Actors.BugFinding.Tests;42{43 {44 [OnEntry(nameof(InitOnEntry))]45 [OnEventGotoState(typeof(UnitEvent), typeof(Init))]46 {47 }48 void InitOnEntry()49 {50 }51 }52}

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using System;2using Microsoft.Coyote.Actors;3using Microsoft.Coyote.Actors.BugFinding.Tests;4{5 static void Main(string[] args)6 {7 ActorRuntime.RegisterActor(typeof(Success));8 ActorRuntime.CreateActor(typeof(Success), null);9 Console.ReadLine();10 }11}12using System;13using Microsoft.Coyote.Actors;14using Microsoft.Coyote.Actors.BugFinding.Tests;15{16 static void Main(string[] args)17 {18 ActorRuntime.RegisterActor(typeof(Fail));19 ActorRuntime.CreateActor(typeof(Fail), null);20 Console.ReadLine();21 }22}23using System;24using Microsoft.Coyote.Actors;25using Microsoft.Coyote.Actors.BugFinding.Tests;26{27 static void Main(string[] args)28 {29 ActorRuntime.RegisterActor(typeof(FailWithException));30 ActorRuntime.CreateActor(typeof(FailWithException), null);31 Console.ReadLine();32 }33}34using System;35using Microsoft.Coyote.Actors;36using Microsoft.Coyote.Actors.BugFinding.Tests;37{38 static void Main(string[] args)39 {40 ActorRuntime.RegisterActor(typeof(FailWithUncaughtException));41 ActorRuntime.CreateActor(typeof(FailWithUncaughtException), null);42 Console.ReadLine();43 }44}45using System;46using Microsoft.Coyote.Actors;47using Microsoft.Coyote.Actors.BugFinding.Tests;48{49 static void Main(string[] args)50 {51 ActorRuntime.RegisterActor(typeof(FailWithUnhandledException));52 ActorRuntime.CreateActor(typeof(FailWithUnhandledException), null);53 Console.ReadLine();54 }55}

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Threading.Tasks;5{6 {7 [OnEntry(nameof(InitOnEntry))]8 [OnEventGotoState(typeof(UnitEvent), typeof(S1))]9 {10 }11 void InitOnEntry()12 {13 this.RaiseEvent(new UnitEvent());14 }15 [OnEntry(nameof(OnS1Entry))]16 {17 }18 void OnS1Entry()19 {20 this.RaiseEvent(new Halt());21 }22 }23}24using System;25using System.Collections.Generic;26using System.Linq;27using System.Threading.Tasks;28{29 {30 [OnEntry(nameof(InitOnEntry))]31 [OnEventGotoState(typeof(UnitEvent), typeof(S1))]32 {33 }34 void InitOnEntry()35 {36 this.RaiseEvent(new UnitEvent());37 }38 [OnEntry(nameof(OnS1Entry))]39 {40 }41 void OnS1Entry()42 {43 this.RaiseEvent(new Halt());44 }45 }46}

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Threading.Tasks;5using Microsoft.Coyote.Actors;6using Microsoft.Coyote.Runtime;7using Microsoft.Coyote.Specifications;8{9 {10 public Success(Event e)11 {12 this.InitOnEntry(e);13 }14 public void InitOnEntry(Event e)15 {16 this.SendEvent(this.Id, new E());17 }18 [OnEventDoAction(typeof(E), nameof(Handle))]19 private class Init : MachineState { }20 private void Handle()21 {22 this.Assert(false);23 }24 }25 public class E : Event { }26}27using System;28using System.Collections.Generic;29using System.Linq;30using System.Threading.Tasks;31using Microsoft.Coyote.Actors;32using Microsoft.Coyote.Runtime;33using Microsoft.Coyote.Specifications;34{35 {36 public Success(Event e)37 {38 this.InitOnEntry(e);39 }40 public void InitOnEntry(Event e)41 {42 this.SendEvent(this.Id, new E());43 }44 [OnEntry(nameof(OnInit))]45 private class Init : MachineState { }46 private void OnInit()47 {48 this.Assert(false);49 }50 }51 public class E : Event { }52}53using System;54using System.Collections.Generic;55using System.Linq;56using System.Threading.Tasks;57using Microsoft.Coyote.Actors;58using Microsoft.Coyote.Runtime;59using Microsoft.Coyote.Specifications;60{61 {62 public Success(Event e)63 {64 this.InitOnEntry(e);65 }66 public void InitOnEntry(Event e)67 {68 this.SendEvent(this.Id, new E());69 }70 [OnEntry(nameof(OnInit))]71 private class Init : MachineState { }72 private void OnInit()73 {74 this.Raise(new E());75 }76 }

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using Microsoft.Coyote.Actors.BugFinding.Tests;2using Microsoft.Coyote.Actors;3using Microsoft.Coyote.Actors.BugFinding.Tests;4using System.Threading.Tasks;5{6 {7 [OnEntry(nameof(InitOnEntry))]8 {9 }10 void InitOnEntry()11 {12 }13 }14}15using Microsoft.Coyote.Actors.BugFinding.Tests;16using Microsoft.Coyote.Actors;17using Microsoft.Coyote.Actors.BugFinding.Tests;18using System.Threading.Tasks;19{20 {21 [OnEntry(nameof(InitOnEntry))]22 {23 }24 void InitOnEntry()25 {26 }27 }28}29using Microsoft.Coyote.Actors.BugFinding.Tests;30using Microsoft.Coyote.Actors;31using Microsoft.Coyote.Actors.BugFinding.Tests;32using System.Threading.Tasks;33{34 {35 [OnEntry(nameof(InitOnEntry))]36 {37 }38 void InitOnEntry()39 {40 }41 }42}43using Microsoft.Coyote.Actors.BugFinding.Tests;44using Microsoft.Coyote.Actors;45using Microsoft.Coyote.Actors.BugFinding.Tests;46using System.Threading.Tasks;47{48 {49 [OnEntry(nameof(InitOnEntry))]50 {51 }52 void InitOnEntry()53 {54 }55 }56}

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using Microsoft.Coyote.Actors.BugFinding.Tests;2using Microsoft.Coyote.Specifications;3using System;4using System.Threading.Tasks;5{6 {7 static void Main(string[] args)8 {9 var machine = new Success();10 machine.InitOnEntry();11 Console.WriteLine("Press any key to exit.");12 Console.ReadKey();13 }14 }15}16 at Microsoft.Coyote.Actors.ActorRuntime.CreateActor(ActorId id, Type type, Object[] args) in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\Actor\ActorRuntime.cs:line 15117 at Microsoft.Coyote.Actors.ActorRuntime.CreateActor(Type type, Object[] args) in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\Actor\ActorRuntime.cs:line 9218 at Microsoft.Coyote.Actors.BugFinding.Tests.Success.InitOnEntry() in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\Actor\BugFinding\Tests\Success.cs:line 2719 at CoyoteTest.Program.Main(String[] args) in C:\Users\mukul\source\repos\CoyoteTest\Program.cs:line 1420 at Microsoft.Coyote.SystematicTesting.TestingEngine.Execute(Boolean isReplay) in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\SystematicTesting\TestingEngine.cs:line 9921 at Microsoft.Coyote.SystematicTesting.TestingEngine.Execute(Boolean isReplay) in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\SystematicTesting\TestingEngine.cs:line 17122 at Microsoft.Coyote.SystematicTesting.TestingEngine.Execute(Boolean isReplay) in C:\Users\mukul\source\repos\mukulikadey\Coyote\Source\SystematicTesting\TestingEngine

Full Screen

Full Screen

InitOnEntry

Using AI Code Generation

copy

Full Screen

1using Microsoft.Coyote.Actors;2using Microsoft.Coyote.Actors.BugFinding.Tests;3using Microsoft.Coyote.Actors.BugFinding.Tests.Success;4{5 {6 static void Main(string[] args)7 {8 ActorRuntime.RegisterActor(typeof(Success));9 ActorRuntime.RegisterActor(typeof(Success2));10 ActorRuntime.RegisterActor(typeof(Success3));11 ActorRuntime.RegisterActor(typeof(Success4));12 ActorRuntime.RegisterActor(typeof(Success5));13 ActorRuntime.RegisterActor(typeof(Success6));14 ActorRuntime.RegisterActor(typeof(Success7));15 ActorRuntime.RegisterActor(typeof(Success8));16 ActorRuntime.RegisterActor(typeof(Success9));17 ActorRuntime.RegisterActor(typeof(Success10));18 ActorRuntime.RegisterActor(typeof(Success11));19 ActorRuntime.RegisterActor(typeof(Success12));20 ActorRuntime.RegisterActor(typeof(Success13));21 ActorRuntime.RegisterActor(typeof(Success14));22 ActorRuntime.RegisterActor(typeof(Success15));23 ActorRuntime.RegisterActor(typeof(Success16));24 ActorRuntime.RegisterActor(typeof(Success17));25 ActorRuntime.RegisterActor(typeof(Success18));26 ActorRuntime.RegisterActor(typeof(Success19));27 ActorRuntime.RegisterActor(typeof(Success20));28 ActorRuntime.RegisterActor(typeof(Success21));29 ActorRuntime.RegisterActor(typeof(Success22));30 ActorRuntime.RegisterActor(typeof(Success23));31 ActorRuntime.RegisterActor(typeof(Success24));32 ActorRuntime.RegisterActor(typeof(Success25));33 ActorRuntime.RegisterActor(typeof(Success26));34 ActorRuntime.RegisterActor(typeof(Success27));35 ActorRuntime.RegisterActor(typeof(Success28));36 ActorRuntime.RegisterActor(typeof(Success29));37 ActorRuntime.RegisterActor(typeof(Success30));38 ActorRuntime.RegisterActor(typeof(Success31));39 ActorRuntime.RegisterActor(typeof(Success32));40 ActorRuntime.RegisterActor(typeof(Success33));41 ActorRuntime.RegisterActor(typeof(Success34));42 ActorRuntime.RegisterActor(typeof(Success35));43 ActorRuntime.RegisterActor(typeof(Success36));44 ActorRuntime.RegisterActor(typeof(Success37));45 ActorRuntime.RegisterActor(typeof(Success38));46 ActorRuntime.RegisterActor(typeof(Success39));47 ActorRuntime.RegisterActor(typeof(Success40));48 ActorRuntime.RegisterActor(typeof(Success41));49 ActorRuntime.RegisterActor(typeof(Success42));50 ActorRuntime.RegisterActor(typeof(Success43));51 ActorRuntime.RegisterActor(typeof(Success44));

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful