[Zope-CVS] CVS: PythonNet/src/testing - IndexerTest.cs:1.1 makefile:NONE

Brian Lloyd brian@zope.com
Thu, 24 Jul 2003 19:55:11 -0400


Update of /cvs-repository/PythonNet/src/testing
In directory cvs.zope.org:/tmp/cvs-serv24649/src/testing

Added Files:
	IndexerTest.cs 
Removed Files:
	makefile 
Log Message:
commit refactorings

=== Added File PythonNet/src/testing/IndexerTest.cs ===
// Copyright (c) 2001, 2002 Zope Corporation and Contributors.
//
// All Rights Reserved.
//
// This software is subject to the provisions of the Zope Public License,
// Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
// WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
// FOR A PARTICULAR PURPOSE.

using System;
using System.Collections;

namespace Python.Test {

    //========================================================================
    // Supports units tests for indexer access.
    //========================================================================


    public class IndexerBase {

	protected Hashtable t;

	protected IndexerBase() {
	    t = new Hashtable();
	}

	protected string GetValue(object index) {
	    object value = t[index];
	    if (value != null) {
		return (string)value;
	    }
	    return null;
	}
	    
    }


    public class PublicIndexerTest : IndexerBase {

	public PublicIndexerTest() : base () {}

	public string this [int index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class ProtectedIndexerTest : IndexerBase {

	public ProtectedIndexerTest() : base () {}

	protected string this [int index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class InternalIndexerTest : IndexerBase {

	public InternalIndexerTest() : base () {}

	internal string this [int index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class PrivateIndexerTest : IndexerBase {

	public PrivateIndexerTest() : base () {}

	private string this [int index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class BooleanIndexerTest : IndexerBase {

	public BooleanIndexerTest() : base() {}

	public string this [bool index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class ByteIndexerTest : IndexerBase {

	public ByteIndexerTest() : base() {}

	public string this [byte index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class SByteIndexerTest : IndexerBase {

	public SByteIndexerTest() : base() {}

	public string this [sbyte index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class CharIndexerTest : IndexerBase {

	public CharIndexerTest() : base() {}

	public string this [char index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class Int16IndexerTest : IndexerBase {

	public Int16IndexerTest() : base() {}

	public string this [short index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class Int32IndexerTest : IndexerBase {

	public Int32IndexerTest() : base() {}

	public string this [int index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class Int64IndexerTest : IndexerBase {

	public Int64IndexerTest() : base() {}

	public string this [long index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class UInt16IndexerTest : IndexerBase {

	public UInt16IndexerTest() : base() {}

	public string this [ushort index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class UInt32IndexerTest : IndexerBase {

	public UInt32IndexerTest() : base() {}

	public string this [uint index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class UInt64IndexerTest : IndexerBase {

	public UInt64IndexerTest() : base() {}

	public string this [ulong index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class SingleIndexerTest : IndexerBase {

	public SingleIndexerTest() : base() {}

	public string this [float index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class DoubleIndexerTest : IndexerBase {

	public DoubleIndexerTest() : base() {}

	public string this [double index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class DecimalIndexerTest : IndexerBase {

	public DecimalIndexerTest() : base() {}

	public string this [decimal index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class StringIndexerTest : IndexerBase {

	public StringIndexerTest() : base() {}

	public string this [string index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class EnumIndexerTest : IndexerBase {

	public EnumIndexerTest() : base() {}

	public string this [ShortEnum index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class ObjectIndexerTest : IndexerBase {

	public ObjectIndexerTest() : base() {}

	public string this [object index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class InterfaceIndexerTest : IndexerBase {

	public InterfaceIndexerTest() : base() {}

	public string this [ISpam index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }


    public class TypedIndexerTest : IndexerBase {

	public TypedIndexerTest() : base() {}

	public string this [Spam index] {
	    get { return GetValue(index); }
	    set { t[index] = value; }
	}

    }





}

=== Removed File PythonNet/src/testing/makefile ===