Esempio n. 1
0
        public void NegtaiveTest()
        {
            GenericsClass <int> testObject = new GenericsClass <int>(3);

            Assert.NotEqual(2, testObject.Position());
            Assert.Equal(0, testObject.ReadMethod(4));
        }
Esempio n. 2
0
        public void ObjectTest()
        {
            GenericsClass <TestClassLearn> testObject = new GenericsClass <TestClassLearn>(1);
            TestClassLearn classobj = new TestClassLearn();

            testObject.WriteMethod(classobj);
            Assert.Equal(1, testObject.Position());
            Assert.Equal(100, testObject.ReadMethod(1).GetMeNumber(10));
        }
Esempio n. 3
0
        public void AddtoGenericClassTest()
        {
            GenericsClass <int> testObject = new GenericsClass <int>(3);

            testObject.WriteMethod(2);
            testObject.WriteMethod(5);
            Assert.Equal(2, testObject.Position());
            Assert.Equal(5, testObject.ReadMethod(2));
        }
Esempio n. 4
0
        public void StringTest()
        {
            GenericsClass <String> testObject = new GenericsClass <String>(3);

            testObject.WriteMethod("Hello");
            Assert.NotEqual(2, testObject.Position());
            testObject.WriteMethod("Good");
            Assert.Equal(2, testObject.Position());
            Assert.NotEqual("Hi", testObject.ReadMethod(1));
        }