Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version

Relationship Oriented Programming - The IDE plus More on Agile Project Management

, 12 Mar 2012 CPOL
An Integrated Development Environment (IDE) for the Relationship Oriented Programming Tool.
ROP_IDE.zip
Clifton.Collections.Generic
bin
Debug
x86
Debug
obj
Debug
TempPE
x86
Debug
TempPE
Properties
Clifton.Data
bin
Debug
x86
Debug
obj
Debug
TempPE
x86
Debug
TempPE
Properties
Clifton.Services
bin
Debug
Release
obj
Debug
TempPE
Properties
Clifton.Tools.Data
articles
raw Serializer
RawSerializer
codepaths.png
codepaths.vsd
rawSerializer1.PNG
rawSerializer2.PNG
rawSerializer3.PNG
bin
Debug
MemoryLeakTesting
Release
x86
Debug
MemoryLeakTesting
Release
Xml Documentation
Xml Documentation
obj
Debug
TempPE
x86
Debug
Refactor
TempPE
UnitTests
Clifton.Tools.Strings
bin
Debug
Release
Xml Documentation
obj
Debug
Refactor
TempPE
Xml Documentation
TempPE
UnitTests
Clifton.Windows.Forms
bin
Debug
Release
obj
Debug
Refactor
TempPE
Properties
Resources
tv_minus.bmp
tv_plus.bmp
XmlTree
DataSetDataProvider
bin
Debug
Release
obj
Debug
TempPE
Properties
IDE
bin
Debug
devexpress
entityEditor.myxaml
graph.myxaml
ide.myxaml
login.myxaml
modelEditor.myxaml
orphans.myxaml
SelectApplicationEntity.myxaml
SelectModelEntity.myxaml
dotnet
ide.myxaml
modelEditor.myxaml
gapma.dataset
graph.png
IDE.exe
IDE.vshost.exe
IDE.vshost.exe.manifest
rop.model
Release
GenericTreeSupport
obj
Debug
TempPE
x86
Debug
TempPE
Properties
Settings.settings
Interfaces.UI
bin
Debug
Release
obj
Debug
TempPE
Properties
Myxaml 2.0
MyXaml.Core
bin
Debug
Release
Xml Documentation
doc
MyXamlCoreUnitTests
obj
Debug
Refactor
TempPE
Release
Xml Documentation
TempPE
MyXaml.WinForms
bin
Debug
Release
Xml Documentation
obj
Debug
Refactor
TempPE
Xml Documentation
TempPE
ROPLib
bin
Debug
Release
obj
Debug
Refactor
TempPE
Properties
ROPLib.csproj.user
ROPLib.Data
bin
Debug
Release
obj
Debug
TempPE
Properties
ROPLib.Graphing
bin
Debug
obj
Debug
TempPE
Properties
ROPLib.Interfaces
bin
Debug
Release
obj
Debug
TempPE
Properties
ROPLib.RendererInterfaces
bin
Debug
Release
obj
Debug
TempPE
Properties
ROPLib.Reporting
bin
Debug
Release
x86
Debug
obj
Debug
TempPE
x86
Debug
TempPE
Properties
ROPLib.UIEvents
bin
Debug
Release
obj
Debug
TempPE
Properties
ROPLib.UIRendering
bin
Debug
Release
obj
Debug
TempPE
Properties
SQLLiteDataProvider
bin
Debug
Release
obj
Debug
TempPE
Properties
UI.DotNet
bin
Debug
Release
obj
Debug
TempPE
Properties
UI.DX
bin
Debug
Release
obj
Debug
TempPE
Properties
licenses.licx
UnitTest
bin
Debug
Release
Xml Documentation
obj
Debug
Refactor
TempPE
Xml Documentation
TempPE
UnitTest.csproj.user
XTreeInterfaces
bin
Debug
Release
obj
Debug
TempPE
Properties
using System;

using Vts.UnitTest;

using MyXaml.Core;
using MyXaml.Core.Exceptions;

namespace MyXamlCoreUnitTests
{
	public class FirstTestClass
	{
		private SecondTestClass secondTestClass;

		public SecondTestClass SecondTestClass
		{
			get {return secondTestClass;}
		}

		public FirstTestClass()
		{
			secondTestClass=new SecondTestClass();
		}
	}

	public class SecondTestClass
	{
		protected string val;

		public string Value
		{
			get {return val;}
		}

		public SecondTestClass()
		{
			val="Marc";
		}
	}

	[TestFixture]
	public class ReferenceTests
	{
		protected Parser parser;

		[SetUp]
		public void SetUp()
		{
			parser=new Parser();
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void AddReferenceNullNameTest()
		{
			parser.AddReference(null, this);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void RemoveReferenceNullNameTest()
		{
			parser.RemoveReference(null);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void ContainsReferenceNullNameTest()
		{
			parser.ContainsReference(null);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void GetReferenceNullNameTest()
		{
			parser.GetReference(null);
		}
		
		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void UpdateReferenceNullNameTest()
		{
			parser.UpdateReference(null, this);
		}
		
		[Test]
		[ExpectedException(typeof(ReferenceExistsException))]
		public void AddExistingReferenceTest()
		{
			parser.AddReference("Test", this);
			parser.AddReference("Test", this);
		}
		
		[Test]
		[ExpectedException(typeof(NoReferenceException))]
		public void RemoveMissingReferenceTest()
		{
			parser.RemoveReference("Test");
		}

		[Test]
		public void AddReferenceTest()
		{
			parser.AddReference("Test", this);
			Assertion.Assert(parser.GetReference("Test")==this, "Unexpected result.");
		}

		[Test]
		public void UpdateReferenceTest()
		{
			parser.AddReference("Test", this);
			parser.UpdateReference("Test", parser);
			Assertion.Assert(parser.GetReference("Test")==parser, "Unexpected result.");
		}

		[Test]
		public void RemoveReferenceTest()
		{
			parser.AddReference("Test", this);
			parser.RemoveReference("Test");
			Assertion.Assert(!parser.ContainsReference("Test"), "Unexpected result.");
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void BadSourceCopyTest()
		{
			parser.CopyReferencesFrom(null);
		}

		[Test]
		public void CopyReferencesTest()
		{
			parser.AddReference("Test", this);
			Parser p2=new Parser();
			p2.CopyReferencesFrom(parser);
			Assertion.Assert(p2.ContainsReference("Test"), "Unexpected result.");
		}

		[Test]
		[ExpectedException(typeof(NoReferenceException))]
		public void SimpleResolveFailureTest()
		{
			FirstTestClass ftc=new FirstTestClass();
			parser.AddReference("ftc", ftc);
			parser.ResolveValue("ftc2");
		}

		[Test]
		[ExpectedException(typeof(ImproperComplexReferenceException))]
		public void ComplexResolveFailureTest()
		{
			FirstTestClass ftc=new FirstTestClass();
			parser.AddReference("ftc", ftc);
			parser.ResolveValue("ftc.foobar");
		}

		[Test]
		public void ResolveSimpleValueTest()
		{
			FirstTestClass ftc=new FirstTestClass();
			parser.AddReference("ftc", ftc);
			object obj=parser.ResolveValue("ftc");
			Assertion.Assert(ftc==obj, "Unexpected result.");
		}

		[Test]
		public void ResolveComplexPropertyValueTest()
		{
			FirstTestClass ftc=new FirstTestClass();
			parser.AddReference("ftc", ftc);
			object obj=parser.ResolveValue("ftc.SecondTestClass.Value");
			Assertion.Assert(obj.ToString()=="Marc", "Unexpected result.");
		}

		[Test]
		public void ResolveComplexFieldValueTest()
		{
			FirstTestClass ftc=new FirstTestClass();
			parser.AddReference("ftc", ftc);
			object obj=parser.ResolveValue("ftc.secondTestClass.val");
			Assertion.Assert(obj.ToString()=="Marc", "Unexpected result.");
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Marc Clifton

United States United States
Marc is the creator of two open source projects, MyXaml, a declarative (XML) instantiation engine and the Advanced Unit Testing framework, and Interacx, a commercial n-tier RAD application suite.  Visit his website, www.marcclifton.com, where you will find many of his articles and his blog.
 
Marc lives in Philmont, NY.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 12 Mar 2012
Article Copyright 2012 by Marc Clifton
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid