Ejemplo n.º 1
0
		public void RequestShouldReturnKnownIfApplicationReceivedEventReceivedFirst()
		{
			var request = new Messages.AppTypeRequest();
			request.AppId = 111;

			var appReceivedEvent = new Messages.SetAppType();
			appReceivedEvent.AppId = 111;

			Test.Initialize();
			Test.Saga<Sagas.AppTypePolicy>()
				.When( r => r.Handle( appReceivedEvent ) )
				.ExpectReply<Messages.AppTypeResponse>( r => r.AppType == Messages.AppType.Known )
				.When( r => r.Handle( request ) );
		}
Ejemplo n.º 2
0
		public void RequestShouldReturnUnknownAsSetAndRequestEventAppIdsDoNotMatch()
		{
			var request = new Messages.AppTypeRequest();
			request.AppId = 111;

			var appReceivedEvent = new Messages.SetAppType();
			appReceivedEvent.AppId = 222;

			Test.Initialize();
			Test.Saga<Sagas.AppTypePolicy>()
				.When( r => r.Handle( appReceivedEvent ) )
				.ExpectReply<Messages.AppTypeResponse>( r => r.AppType == Messages.AppType.Unknown )
				.When( r => r.Handle( request ) );

		}
Ejemplo n.º 3
0
        public void RequestShouldReturnUnknownAsSetAndRequestEventAppIdsDoNotMatch()
        {
            var request = new Messages.AppTypeRequest();

            request.AppId = 111;

            var appReceivedEvent = new Messages.SetAppType();

            appReceivedEvent.AppId = 222;

            Test.Initialize();
            Test.Saga <Sagas.AppTypePolicy>()
            .When(r => r.Handle(appReceivedEvent))
            .ExpectReply <Messages.AppTypeResponse>(r => r.AppType == Messages.AppType.Unknown)
            .When(r => r.Handle(request));
        }
Ejemplo n.º 4
0
        public void RequestShouldReturnKnownIfApplicationReceivedEventReceivedFirst()
        {
            var request = new Messages.AppTypeRequest();

            request.AppId = 111;

            var appReceivedEvent = new Messages.SetAppType();

            appReceivedEvent.AppId = 111;

            Test.Initialize();
            Test.Saga <Sagas.AppTypePolicy>()
            .When(r => r.Handle(appReceivedEvent))
            .ExpectReply <Messages.AppTypeResponse>(r => r.AppType == Messages.AppType.Known)
            .When(r => r.Handle(request));
        }
 public void Handle(Messages.SetAppType message)
 {
     this.Data.AppId   = message.AppId;
     this.Data.AppType = Messages.AppType.Known;
 }