|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Technewlogic.Stasy.Test.Model;
using Technewlogic.Stasy.Framework.Proxy;
using Technewlogic.Stasy.Framework;
using System.Threading;
using Technewlogic.Stasy.Framework.Transactions;
using Technewlogic.Stasy.Framework.UnitOfWork;
namespace Technewlogic.Stasy.Test.MetaModelTests
{
class ContextReadableError
{
[EntityCollection]
public CompositeCollection<Customer> Customers { get; set; }
[EntityCollection]
public CompositeCollection<OrderTypeCompositor> OrderTypeCompositors { get; set; }
[EntityCollection]
public List<OrderType> OrderTypes { get; set; }
[EntityCollection]
public IEnumerable<Order> Orders { get; set; }
[EntityCollection]
public IEnumerable<Material> Materials { get; set; }
}
class ContextWritableError
{
[EntityCollection]
public CompositeCollection<Customer> Customers { get; set; }
[EntityCollection]
public List<OrderTypeCompositor> OrderTypeCompositors { get; set; }
[EntityCollection]
public IEnumerable<OrderType> OrderTypes { get; set; }
[EntityCollection]
public IEnumerable<Order> Orders { get; set; }
[EntityCollection]
public IEnumerable<Material> Materials { get; set; }
}
[TestFixture]
public class General
{
[TestFixtureSetUp]
public void TestFixtureSetUp()
{
}
[SetUp]
public void SetUp()
{
}
[Test]
[ExpectedException(typeof(ModelConfigurationException),
ExpectedMessage = "The collection property 'OrderTypes' registered in the context must be of type 'IEnumerable`1', but it is of type 'List`1'.")]
public void WrongContextCollectionConfiguration_Readable()
{
var context = new ContextReadableError();
var engine = EngineFactory.CreateEngine(
new DataContextMockSyncProvider(new DataContextMock()),
context);
}
[Test]
[ExpectedException(typeof(ModelConfigurationException),
ExpectedMessage = "The collection property 'OrderTypeCompositors' registered in the context must be of type 'CompositeCollection`1', but it is of type 'List`1'.")]
public void WrongContextCollectionConfiguration_Writable()
{
var context = new ContextWritableError();
var engine = EngineFactory.CreateEngine(
new DataContextMockSyncProvider(new DataContextMock()),
context);
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.