Beispiel #1
0
        public void PrivateVoid2Args_Test()
        {
            // SETUP
            FooVoidMethods fooObject = new FooVoidMethods()
            {
                fileName    = "PrivateVoid2Args_Test.txt",
                fileContent = "Test run: " + DateTime.Now.ToString()
            };
            int myIntParam = 10;

            object[] methodArguments = new object[]
            {
                "This is the argument passed to the method",
                myIntParam
            };

            // EXERCISE
            tester.AccessPrivateMethod("MyPrivateMethod2Arg", methodArguments, fooObject);

            // ASSERT
            if (!File.Exists(fooObject.fileName))
            {
                Assert.True(false, "PrivateVoid2Args_Test didn't ran correctly");
            }

            // CLEANUP
            File.Delete(fooObject.fileName);
        }
Beispiel #2
0
        public void PrivateVoidObjectArgs_Test()
        {
            // SETUP
            FooVoidMethods fooObject = new FooVoidMethods()
            {
                fileName    = "MyPrivateMethod1ArgObject.txt",
                fileContent = "Test run: " + DateTime.Now.ToString()
            };
            List <string> myInputParamList = new List <string>()
            {
                "This ",
                "is an example of object passed as parameter"
            };

            object[] methodArguments = new object[]
            {
                myInputParamList
            };

            // EXERCISE
            tester.AccessPrivateMethod("MyPrivateMethod1ArgObject", methodArguments, fooObject);

            // ASSERT
            if (!File.Exists(fooObject.fileName))
            {
                Assert.True(false, "PrivateVoidObjectArgs_Test didn't ran correctly");
            }

            // CLEANUP
            File.Delete(fooObject.fileName);
        }
Beispiel #3
0
        public void PrivateVoidNoArgs_Test()
        {
            // SETUP
            FooVoidMethods fooObject = new FooVoidMethods()
            {
                fileName    = "PrivateVoidNoArgs_Test.txt",
                fileContent = "Test run: " + DateTime.Now.ToString()
            };

            // EXERCISE
            tester.AccessPrivateMethod("MyPrivateMethodNoArgs", null, fooObject);

            // ASSERT
            if (!File.Exists(fooObject.fileName))
            {
                Assert.True(false, "PrivateVoidNoArgs_Test didn't ran correctly");
            }

            // CLEANUP
            File.Delete(fooObject.fileName);
        }