//ignore /// <exception cref="System.Exception"/> public virtual void TestGet() { TestGenericWritable.Foo foo = new TestGenericWritable.Foo(); TestGenericWritable.FooGenericWritable generic = new TestGenericWritable.FooGenericWritable (); generic.Set(foo); Assert.Equal(foo, generic.Get()); }
/// <exception cref="System.Exception"/> public virtual void TestFooWritable() { System.Console.Out.WriteLine("Testing Writable wrapped in GenericWritable"); TestGenericWritable.FooGenericWritable generic = new TestGenericWritable.FooGenericWritable (); generic.SetConf(conf); TestGenericWritable.Foo foo = new TestGenericWritable.Foo(); generic.Set(foo); TestWritable.TestWritable(generic); }
/// <exception cref="System.Exception"/> public virtual void TestSet() { TestGenericWritable.Foo foo = new TestGenericWritable.Foo(); TestGenericWritable.FooGenericWritable generic = new TestGenericWritable.FooGenericWritable (); //exception should not occur generic.Set(foo); try { //exception should occur, since IntWritable is not registered generic = new TestGenericWritable.FooGenericWritable(); generic.Set(new IntWritable(1)); Fail("Generic writable should have thrown an exception for a Writable not registered" ); } catch (RuntimeException) { } }