// // MyClass.cs // // Author: // Paul Schneider // // Copyright (c) 2015 GNU GPL // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . using System; using Machine.Specifications; using Yavsc.Model.WorkFlow; using NUnit.Framework; namespace TestAPI { [Subject(typeof(Automate),"simple automate")] public class CreatingAnAutomate { static Automate Subject; /// /// The context. /// Establish context = () => { // ... any mocking, stubbing, or other setup ... Subject = new Automate(); }; Because of = () => Subject.AddTransition(0,1,'a'); /// /// The should be in state 0. /// It should_be_in_state_0 = () => Subject.State.ShouldEqual(0); /// /// The should not be in state 1. /// It should_not_be_in_state_1 = () => Subject.State.ShouldNotEqual(1); /// /// The state of the should not indicate o as final. /// It should_not_indicate_O_as_final_state = () => Subject.IsInFinalState().ShouldNotEqual(true); [Test] public void DoTheTest() { context.Invoke (); of.Invoke (); should_be_in_state_0.Invoke (); should_not_be_in_state_1.Invoke (); should_not_indicate_O_as_final_state.Invoke (); } } }