using Azimuth; using UnitTestSharp; namespace Glass.Blacklight.UnitTests { public class TintLookTests : TestFixture { public static AffineMatrix Moved() { AffineMatrix returnMe = AffineMatrix.Identity; returnMe.Translate(new Vector(1, 2)); return returnMe; } public static TintLook LookWith(ITexture texture) { return new TintLook { Texture = texture, Transform = AffineMatrix.Identity, Space = TintSpace.Screen }; } public class MatchesTests : TestFixture { public void SameTextureTransformAndSpace_Match() { var texture = new BlacklightGlassTexture(); CheckTrue(LookWith(texture).Matches(LookWith(texture))); } public void NoTextureOnEitherSide_Match() { CheckTrue(LookWith(null).Matches(LookWith(null))); } public void DifferentTextureObjects_DoNotMatch() { CheckFalse(LookWith(new BlacklightGlassTexture()).Matches(LookWith(new BlacklightGlassTexture()))); } public void TextureOnOneSideOnly_DoNotMatch() { CheckFalse(LookWith(new BlacklightGlassTexture()).Matches(LookWith(null))); } public void DifferentTransform_DoNotMatch() { var texture = new BlacklightGlassTexture(); TintLook moved = LookWith(texture); moved.Transform = Moved(); CheckFalse(LookWith(texture).Matches(moved)); } public void DifferentSpace_DoNotMatch() { var texture = new BlacklightGlassTexture(); TintLook model = LookWith(texture); model.Space = TintSpace.Model; CheckFalse(LookWith(texture).Matches(model)); } } } }