public void CreateReferenceAndSetIteratorToFirst_PassingTest()
        {
            StringArgumentMarshaler m = new StringArgumentMarshaler();
            Iterator <string>       i = new Iterator <string>(testData);

            m.Set(i);

            Assert.Equal(testData[0], m.Value);
            Assert.Equal(testData[1], i.Current);
        }
示例#2
0
        public void StringArgumentMarshalerSetValue_PassingTest()
        {
            _argumentMarshaler.Set(_iterator);

            Assert.Equal(_iterator.Previous(), _argumentMarshaler.Value);
        }
        public void CreateReferenceAndSetIteratorToLast_FailingTest()
        {
            StringArgumentMarshaler m = new StringArgumentMarshaler();
            Iterator <string>       i = new Iterator <string>(testData);

            for (int j = 0; j < this.testData.Count; j++)
            {
                i.Next();
            }

            ArgumentsException ex = Assert.Throws <StringArgumentMarshaler.StringMarshalerException>(() => m.Set(i));

            ex.ErrorArgumentId = this.testString;

            Assert.Equal(ErrorCode.MISSING, ex.ErrorCode);
            Assert.Equal($"Could not find string parameter for -{this.testString}", ex.ErrorMessage());
        }
        public void CreateReferenceAndSetNull_FailingTest()
        {
            StringArgumentMarshaler m = new StringArgumentMarshaler();

            Assert.Throws <NullReferenceException>(() => m.Set(null));
        }