Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - if_file_exists_load_entries ()
- - if_file_missing_load_last ()
- - if_no_files_create_new_entries ()
- - if_exception_clear_entries_and_log ()
- - loaded_entries_init_called ()
- - Other tests
- - if_file_exists_load_entries _AND_STORE_AS_LAST()
- - if_file_missing_load_last _AND_STORE_AS_LAST_AND_WARNING_MESSAGE()
- - if_no_files_create_new_entries _AND_WARNING_MESSAGE()
- - if_exception_clear_entries_and_log _AND_ERROR_MESSAGE()
- - loaded_entries_init_called _AND_SUCCESS_MESSAGE()
- - Other tests
- - if_file_exists_load_entries _AND_INFO_MESSAGE()
- - if_file_missing_load_last _AND_INFO_MESSAGE()
- - if_no_files_create_new_entries _AND_INFO_MESSAGE()
- - if_exception_clear_entries_and_log _AND_ERROR_MESSAGE_AND_SHUTDOWN()
- - loaded_entries_init_called _AND_SUCCESS_MESSAGE()
- - Other tests
- // Public method tests
- [TestFixture]
- public class PublicMethodTests: IBehaviour1Test
- {
- // Behaviour 1
- Behaviour1Test _behaviour1;
- IEnumerable<TestCaseData> Behaviour1TestCases{ get { return _behaviour1.GetTestCases(); } }
- [Test]
- [TestCaseSource("Behaviour1TestCases")]
- public void RunBehaviour1Test(Action<IBehaviour1Test> runTestCase)
- {
- runTestCase(this);
- }
- // ==============================
- // Behaviour 1 Arrange/act/assert
- void IBehaviour1Test.Arrange(){}
- void IBehaviour1Test.Assert(object result){}
- object IBehaviour1Test.Act()
- {
- return _model.PublicMethod();
- }
- // Other tests
- }
- // Implement this in order to run Behaviour1 test cases
- interface IBehaviour1Test
- {
- void Arrange();
- object Act();
- void Assert(object retValue);
- }
- // Collection of tests for behaviour 1
- public class Behaviour1Test
- {
- // Generate test cases
- IEnumerable<TestCaseData>() GetTestCases()
- {
- yield return new TestCaseData((Action<IBehaviour1Test>)Test_1);
- yield return new TestCaseData((Action<IBehaviour1Test>)Test_2);
- yield return new TestCaseData((Action<IBehaviour1Test>)Test_3);
- }
- void Test_1(IBehaviour1Test impl)
- {
- // Arrange
- impl.Arrange(); // public method's arrange
- Test1Setup(); // Arrange for this test
- // Act
- var result = impl.Act();
- // Assert
- Test1Assert(result); // Assert for this test
- impl.Assert(result); // Assert on public method
- }
- void Test_2(IBehaviour1Test impl){}
- void Test_3(IBehaviour1Test impl){}
- }
- private void verifyField(expected1, extpected2, ....){
- equals(actual1, expected1, 'expected1 correct);
- ....
- }
Add Comment
Please, Sign In to add comment