[Zope-CVS] CVS: PythonNet/src/testing - ClassTest.cs:1.1 ConversionTest.cs:1.1 DelegateTest.cs:1.1 EnumTest.cs:1.1 EventTest.cs:1.1 FieldTest.cs:1.1 GlobalTest.cs:1.1 InterfaceTest.cs:1.1 MethodTest.cs:1.1 PropertyTest.cs:1.1 makefile:1.1

Brian Lloyd brian@zope.com
Mon, 14 Jul 2003 16:00:17 -0400


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

Added Files:
	ClassTest.cs ConversionTest.cs DelegateTest.cs EnumTest.cs 
	EventTest.cs FieldTest.cs GlobalTest.cs InterfaceTest.cs 
	MethodTest.cs PropertyTest.cs makefile 
Log Message:
refactor repository

=== Added File PythonNet/src/testing/ClassTest.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;

namespace Python.Test {

    //========================================================================
    // Supports CLR class unit tests.
    //========================================================================

    public class ClassTest {


    }

    internal class InternalClass {


    }

}


=== Added File PythonNet/src/testing/ConversionTest.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;


namespace Python.Test {

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

    public class ConversionTest {

	public ConversionTest() {
	    EnumField = ShortEnum.Zero;
	    SpamField = new Spam("spam");
	    StringField = "spam";
	}

	public bool BooleanField = false;
	public byte ByteField = 0;
	public sbyte SByteField = 0;
	public char CharField = 'A';
	public short Int16Field = 0;
	public int Int32Field = 0;
	public long Int64Field = 0;
	public ushort UInt16Field = 0;
	public uint UInt32Field = 0;
	public ulong UInt64Field = 0;
	public float SingleField = 0.0F;
	public double DoubleField = 0.0;
	public decimal DecimalField = 0;
	public string StringField;
	public ShortEnum EnumField;
	public object ObjectField = null;
	public ISpam SpamField;
    }


    public interface ISpam {
	string GetValue();
    }

    public class Spam : ISpam {
	string value;

	public Spam(string value) {
	    this.value = value;
	}

	public string GetValue() {
	    return value;

	}
    }

}


=== Added File PythonNet/src/testing/DelegateTest.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;

namespace Python.Test {

    //========================================================================
    // Supports CLR class unit tests.
    //========================================================================

    public delegate void PublicDelegate();
    internal delegate void InternalDelegate();

    public delegate DelegateTest ObjectDelegate();
    public delegate string StringDelegate();


    public class DelegateTest {

	public delegate void PublicDelegate();
	protected delegate void ProtectedDelegate();
	internal delegate void InternalDelegate();
	private delegate void PrivateDelegate();

	public StringDelegate stringDelegate;
	public ObjectDelegate objectDelegate;

	public DelegateTest() {

	}

	public string SayHello() {
	    return "hello";
	}

	public static string StaticSayHello() {
	    return "hello";
	}

	public string CallStringDelegate(StringDelegate d) {
	    return d();
	}

	public DelegateTest CallObjectDelegate(ObjectDelegate d) {
	    return d();
	}

    }


}


=== Added File PythonNet/src/testing/EnumTest.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;

namespace Python.Test {

    //========================================================================
    // Supports CLR enum unit tests.
    //========================================================================

    public enum ByteEnum : byte {
	Zero,
	One,
	Two
    }

    public enum SByteEnum : sbyte {
	Zero,
	One,
	Two
    }

    public enum ShortEnum : short {
	Zero,
	One,
	Two
    }

    public enum UShortEnum : ushort {
	Zero,
	One,
	Two
    }

    public enum IntEnum : int{
	Zero,
	One,
	Two
    }

    public enum UIntEnum : uint {
	Zero,
	One,
	Two
    }

    public enum LongEnum : long {
	Zero,
	One,
	Two
    }

    public enum ULongEnum : ulong {
	Zero,
	One,
	Two
    }

}


=== Added File PythonNet/src/testing/EventTest.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;

namespace Python.Test {

    //========================================================================
    // Supports CLR event unit tests.
    //========================================================================

    public class EventTest {


    }

}


=== Added File PythonNet/src/testing/FieldTest.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;


namespace Python.Test {

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

    public class FieldTest {

	public FieldTest() {
	    EnumField = ShortEnum.Zero;
	    SpamField = new Spam("spam");
	    StringField = "spam";
	}

	public void Shutup() {
	    int i = PrivateStaticField;
	    int j = PrivateField;
	}

	public static readonly int ReadOnlyStaticField = 0;
	protected static int ProtectedStaticField = 0;
	internal static int InternalStaticField = 0;
	private static int PrivateStaticField = 0;
	public static int PublicStaticField = 0;

	public const int ConstField = 0;
	public readonly int ReadOnlyField = 0;
	internal int InternalField = 0;
	protected int ProtectedField = 0;
	private int PrivateField = 0;
	public int PublicField = 0;

	public bool BooleanField = false;
	public byte ByteField = 0;
	public sbyte SByteField = 0;
	public char CharField = 'A';
	public short Int16Field = 0;
	public int Int32Field = 0;
	public long Int64Field = 0;
	public ushort UInt16Field = 0;
	public uint UInt32Field = 0;
	public ulong UInt64Field = 0;
	public float SingleField = 0.0F;
	public double DoubleField = 0.0;
	public decimal DecimalField = 0;
	public string StringField;
	public ShortEnum EnumField;
	public object ObjectField;
	public ISpam SpamField;

    }


}


=== Added File PythonNet/src/testing/GlobalTest.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;

//========================================================================
// Supports units tests for access to types without a namespace.
//========================================================================

public class NoNamespaceType {}




=== Added File PythonNet/src/testing/InterfaceTest.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;

namespace Python.Test {

    //========================================================================
    // Supports CLR class unit tests.
    //========================================================================

    public interface IPublicInterface {}

    internal interface IInternalInterface {}



    public interface ISayHello1 {
	string SayHello();
    }

    public interface ISayHello2 {
	string SayHello();
    }

    public class InterfaceTest : ISayHello1, ISayHello2{

	public InterfaceTest() {}

	public string HelloProperty {
	    get { return "hello"; }
	}

	string ISayHello1.SayHello() {
	    return "hello 1";
	}

	string ISayHello2.SayHello() {
	    return "hello 2";
	}

	public interface IPublic {}

	protected interface IProtected {}

	internal interface IInternal {}

	private interface IPrivate {}

    }


}


=== Added File PythonNet/src/testing/MethodTest.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;

namespace Python.Test {

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

    public class MethodTest {

	public MethodTest() {}

	public string PublicMethod() {
	    return "public";
	}

	public static string PublicStaticMethod() {
	    return "public static";
	}

	protected string ProtectedMethod() {
	    return "protected";
	}

	protected static string ProtectedStaticMethod() {
	    return "protected static";
	}

	internal string InternalMethod() {
	    return "internal";
	}

	internal static string InternalStaticMethod() {
	    return "internal static";
	}

	private string PrivateMethod() {
	    return "private";
	}

	private static string PrivateStaticMethod() {
	    return "private static";
	}



    }

}


=== Added File PythonNet/src/testing/PropertyTest.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;

namespace Python.Test {

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

    public class PropertyTest {

	public PropertyTest() {}

	int _public_property = 0;
	public int PublicProperty {
	    get { return _public_property; }
	    set { _public_property = value; }
	}

	static int _public_static_property = 0;
	public static int PublicStaticProperty {
	    get { return _public_static_property; }
	    set { _public_static_property = value; }
	}

	int _protected_property = 0;
	protected int ProtectedProperty {
	    get { return _protected_property; }
	    set { _protected_property = value; }
	}

	static int _protected_static_property = 0;
	protected static int ProtectedStaticProperty {
	    get { return _protected_static_property; }
	    set { _protected_static_property = value; }
	}

	int _internal_property = 0;
	internal int InternalProperty {
	    get { return _internal_property; }
	    set { _internal_property = value; }
	}

	static int _internal_static_property = 0;
	internal static int InternalStaticProperty {
	    get { return _internal_static_property; }
	    set { _internal_static_property = value; }
	}

	int _private_property = 0;
	private int PrivateProperty {
	    get { return _private_property; }
	    set { _private_property = value; }
	}

	static int _private_static_property = 0;
	private static int PrivateStaticProperty {
	    get { return _private_static_property; }
	    set { _private_static_property = value; }
	}

	ShortEnum _enum_property = ShortEnum.Zero;

	public ShortEnum EnumProperty {
	    get { return _enum_property; }
	    set { _enum_property = value; }
	}

    }

}


=== Added File PythonNet/src/testing/makefile ===
# Makefile for the Python runtime test support assembly.

CSC=csc.exe

all: Python.Test.dll

Python.Test.dll:
	$(CSC) /nologo /target:library /out:../../Python.Test.dll \
	/reference:../../Python.Runtime.dll \
	/recurse:*.cs

clean:
	rm -f ../../Python.Test.dll