Exemplo n.º 1
0
        public void test2()
        {
            var e1 = new DeveloperCreated {
                Name = "Vasya"
            };
            var e2 = new DeveloperCreated {
                Name = "Dima"
            };

            var state = new DeveloperState();

            state.Apply(e2);
            state.Apply(e1);
            state.Apply(e2);
            state.Apply(e1);


            var factory = new ProcessFactory();
            var agr     = factory.Create <DeveloperAR>();

            var result = agr.Execute(new ChangeDeveloperName()
            {
                NewName = "Cohen"
            }, new CommandMetadata(), state);

            Assert.That(((DeveloperNameChanged)result.First().Message).NewName, Is.EqualTo("Cohen"));
        }
Exemplo n.º 2
0
		/// <summary>
		/// Sets the developer's state.
		/// </summary>
		/// <param name="state">The new state</param>
		protected virtual void SetState(DeveloperState state)
		{
			lock (this)
			{
				m_state = state;

				if (state == DeveloperState.Coding)
				{
					m_CodingCount++;
				}

				OnStateChanged();
			}
		}
Exemplo n.º 3
0
        /// <summary>
        /// Sets the developer's state.
        /// </summary>
        /// <param name="state">The new state</param>
        protected virtual void SetState(DeveloperState state)
        {
            lock (this)
            {
                m_state = state;

                if (state == DeveloperState.Coding)
                {
                    m_CodingCount++;
                }

                OnStateChanged();
            }
        }