|
using System;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Yap.Data.Client;
namespace Yap.Data.UnitTest
{
[TestClass]
public class EntityScriptCommandTestFixture
{
[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
public void Constructor_EntityIsNull_ThrowArgumentNullException()
{
new EntityScriptCommand<Destination>(
null, "SELECT * FROM dual");
}
[TestMethod]
public void Execute_OnRectangle_ReturnInitializedInstance()
{
var command = new EntityScriptCommand<Rectangle>(
new Rectangle(),
@"
SET <Location.X> = 1
SET <Location.Y> = 2
SET <Width> = 3
SET <Height> = 4");
command.Execute();
var rectangle = command.Entity;
Assert.AreEqual(1, rectangle.Location.X);
Assert.AreEqual(2, rectangle.Location.Y);
Assert.AreEqual(3, rectangle.Width);
Assert.AreEqual(4, rectangle.Height);
}
}
}
|
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.