diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj index 923ebbf5..77cac6be 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj @@ -37,6 +37,7 @@ False + @@ -62,6 +63,7 @@ + diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj index f513cd14..a1e5dcb9 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj @@ -37,6 +37,7 @@ False + @@ -62,6 +63,7 @@ + diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj index fe527913..d6ed04a1 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj @@ -37,6 +37,7 @@ False + @@ -63,6 +64,7 @@ + diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj index 1164e88e..d09fe709 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj @@ -39,6 +39,7 @@ False + @@ -64,6 +65,7 @@ + diff --git a/ANX.Framework.TestCenter/Strukturen/GameServiceContainerTest.cs b/ANX.Framework.TestCenter/Strukturen/GameServiceContainerTest.cs new file mode 100644 index 00000000..ecaf2ab8 --- /dev/null +++ b/ANX.Framework.TestCenter/Strukturen/GameServiceContainerTest.cs @@ -0,0 +1,89 @@ +using System; +using NUnit.Framework; + +using XNAGameServiceContainer = Microsoft.Xna.Framework.GameServiceContainer; +using ANXGameServiceContainer = ANX.Framework.GameServiceContainer; + +// This file is part of the ANX.Framework created by the +// "ANX.Framework developer group" and released under the Ms-PL license. +// For details see: http://anxframework.codeplex.com/license + +namespace ANX.Framework.TestCenter.Strukturen +{ + [TestFixture] + public class GameServiceContainerTest + { + [Test] + public void GetServiceWithoutRegisteredService() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + Assert.Null(xna.GetService(typeof(int))); + Assert.Null(anx.GetService(typeof(int))); + Assert.AreEqual(xna.GetService(typeof(int)), anx.GetService(typeof(int))); + } + + [Test] + public void GetServiceWithNullType() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + AssertHelper.ConvertEquals(Assert.Throws(() => xna.GetService(null)), + Assert.Throws(() => anx.GetService(null)), "GetServiceWithNullType"); + } + + [Test] + public void AddServiceWithNullType() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + AssertHelper.ConvertEquals(Assert.Throws(() => xna.AddService(null, null)), + Assert.Throws(() => anx.AddService(null, null)), "AddServiceWithNullType"); + } + + [Test] + public void AddServiceWithNullProvider() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + AssertHelper.ConvertEquals(Assert.Throws(() => xna.AddService(typeof(int), null)), + Assert.Throws(() => anx.AddService(typeof(int), null)), "AddServiceWithNullProvider"); + } + + [Test] + public void RemoveServiceWithNullType() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + AssertHelper.ConvertEquals(Assert.Throws(() => xna.RemoveService(null)), + Assert.Throws(() => anx.RemoveService(null)), "RemoveServiceWithNullType"); + } + + [Test] + public void RemoveServiceWithoutRegisteredService() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + Assert.DoesNotThrow(() => xna.RemoveService(typeof(int))); + Assert.DoesNotThrow(() => anx.RemoveService(typeof(int))); + } + + [Test] + public void AddAndGetService() + { + var xna = new XNAGameServiceContainer(); + var anx = new ANXGameServiceContainer(); + + xna.AddService(typeof(int), 15); + anx.AddService(typeof(int), 15); + + Assert.AreEqual(xna.GetService(typeof(int)), anx.GetService(typeof(int))); + } + } +} diff --git a/ANX.Framework/Audio/AudioCategory.cs b/ANX.Framework/Audio/AudioCategory.cs index 58033886..9aae86e8 100644 --- a/ANX.Framework/Audio/AudioCategory.cs +++ b/ANX.Framework/Audio/AudioCategory.cs @@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Audio { [PercentageComplete(30)] + [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public struct AudioCategory : IEquatable { diff --git a/ANX.Framework/Audio/Cue.cs b/ANX.Framework/Audio/Cue.cs index feb1ac94..9887c8bf 100644 --- a/ANX.Framework/Audio/Cue.cs +++ b/ANX.Framework/Audio/Cue.cs @@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Audio { [PercentageComplete(5)] + [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public sealed class Cue : IDisposable { diff --git a/ANX.Framework/Audio/SoundBank.cs b/ANX.Framework/Audio/SoundBank.cs index 76d667fe..2fc25823 100644 --- a/ANX.Framework/Audio/SoundBank.cs +++ b/ANX.Framework/Audio/SoundBank.cs @@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Audio { [PercentageComplete(0)] + [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public class SoundBank : IDisposable { diff --git a/ANX.Framework/Audio/WaveBank.cs b/ANX.Framework/Audio/WaveBank.cs index e5542eac..8af3e305 100644 --- a/ANX.Framework/Audio/WaveBank.cs +++ b/ANX.Framework/Audio/WaveBank.cs @@ -8,6 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Audio { [PercentageComplete(0)] + [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public class WaveBank : IDisposable { diff --git a/ANX.Framework/BoundingBox.cs b/ANX.Framework/BoundingBox.cs index b7049e36..d4c26e26 100644 --- a/ANX.Framework/BoundingBox.cs +++ b/ANX.Framework/BoundingBox.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("xToast, Glatzemann")] [TestState(TestStateAttribute.TestState.InProgress)] public struct BoundingBox : IEquatable { diff --git a/ANX.Framework/BoundingFrustum.cs b/ANX.Framework/BoundingFrustum.cs index 3faa964c..05fcda47 100644 --- a/ANX.Framework/BoundingFrustum.cs +++ b/ANX.Framework/BoundingFrustum.cs @@ -13,7 +13,7 @@ namespace ANX.Framework { [PercentageComplete(100)] [TestState(TestStateAttribute.TestState.InProgress)] - [Developer("???, Glatzemann")] + [Developer("xToast, Glatzemann")] public class BoundingFrustum : IEquatable { #region fields diff --git a/ANX.Framework/BoundingSphere.cs b/ANX.Framework/BoundingSphere.cs index 77d50468..bcf058c1 100644 --- a/ANX.Framework/BoundingSphere.cs +++ b/ANX.Framework/BoundingSphere.cs @@ -13,7 +13,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("xToast")] [TestState(TestStateAttribute.TestState.InProgress)] public struct BoundingSphere : IEquatable { @@ -416,16 +416,14 @@ namespace ANX.Framework } #endregion - #region ToString - public override string ToString() - { - var culture = CultureInfo.CurrentCulture; - // This may look a bit more ugly, but String.Format should - // be avoided cause of it's bad performance! - return "{Center:" + Center.ToString() + - " Radius:" + Radius.ToString(culture) + "}"; - } - #endregion + #region ToString + public override string ToString() + { + var culture = CultureInfo.CurrentCulture; + // This may look a bit more ugly, but String.Format should be avoided cause of it's bad performance! + return "{Center:" + Center.ToString() + " Radius:" + Radius.ToString(culture) + "}"; + } + #endregion #region IEquatable implementation public override bool Equals(Object obj) diff --git a/ANX.Framework/Color.cs b/ANX.Framework/Color.cs index 1b6a9a6a..74a2d4ce 100644 --- a/ANX.Framework/Color.cs +++ b/ANX.Framework/Color.cs @@ -9,7 +9,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("Glatzemann, SilentWarrior")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Color : IPackedVector, IPackedVector, IEquatable { diff --git a/ANX.Framework/Content/ContentTypeReader.cs b/ANX.Framework/Content/ContentTypeReader.cs index fce42e68..501a3a75 100644 --- a/ANX.Framework/Content/ContentTypeReader.cs +++ b/ANX.Framework/Content/ContentTypeReader.cs @@ -12,6 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Content { [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public abstract class ContentTypeReader { /// @@ -55,6 +56,8 @@ namespace ANX.Framework.Content protected internal abstract object Read(ContentReader input, object existingInstance); } + [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public abstract class ContentTypeReader : ContentTypeReader { /// diff --git a/ANX.Framework/Content/LzxDecoder.cs b/ANX.Framework/Content/LzxDecoder.cs index 94f9d653..46abc912 100644 --- a/ANX.Framework/Content/LzxDecoder.cs +++ b/ANX.Framework/Content/LzxDecoder.cs @@ -780,7 +780,7 @@ namespace ANX.Framework.Content } /* EXCEPTIONS */ - public class UnsupportedWindowSizeRange : Exception + internal class UnsupportedWindowSizeRange : Exception { } } \ No newline at end of file diff --git a/ANX.Framework/CurveKey.cs b/ANX.Framework/CurveKey.cs index 09608c51..1686ae57 100644 --- a/ANX.Framework/CurveKey.cs +++ b/ANX.Framework/CurveKey.cs @@ -8,7 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("floAr, Glatzemann")] [TestState(TestStateAttribute.TestState.Tested)] public class CurveKey : IEquatable, IComparable { diff --git a/ANX.Framework/CurveKeyCollection.cs b/ANX.Framework/CurveKeyCollection.cs index 82e86821..f86031fb 100644 --- a/ANX.Framework/CurveKeyCollection.cs +++ b/ANX.Framework/CurveKeyCollection.cs @@ -10,7 +10,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???, AstrorEnales")] + [Developer("floAr, AstrorEnales")] [TestState(TestStateAttribute.TestState.Tested)] public class CurveKeyCollection : ICollection, IEnumerable, IEnumerable { diff --git a/ANX.Framework/GameServiceContainer.cs b/ANX.Framework/GameServiceContainer.cs index d802ec82..1b265f1c 100644 --- a/ANX.Framework/GameServiceContainer.cs +++ b/ANX.Framework/GameServiceContainer.cs @@ -12,11 +12,11 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [TestState(TestStateAttribute.TestState.Untested)] + [TestState(TestStateAttribute.TestState.Tested)] [Developer("Glatzemann")] public class GameServiceContainer : IServiceProvider { - private Dictionary services; + private readonly Dictionary services; public GameServiceContainer() { @@ -44,7 +44,7 @@ namespace ANX.Framework throw new ArgumentNullException("type"); } - Object obj = null; + Object obj; this.services.TryGetValue(type, out obj); return obj; } diff --git a/ANX.Framework/MathHelper.cs b/ANX.Framework/MathHelper.cs index 75baaed4..94cbae32 100644 --- a/ANX.Framework/MathHelper.cs +++ b/ANX.Framework/MathHelper.cs @@ -38,7 +38,7 @@ SOFTWARE. namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("Glatzemann, rene87")] [TestState(TestStateAttribute.TestState.Tested)] public static class MathHelper { diff --git a/ANX.Framework/Matrix.cs b/ANX.Framework/Matrix.cs index 0ce358fe..a3616350 100644 --- a/ANX.Framework/Matrix.cs +++ b/ANX.Framework/Matrix.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(70)] - [Developer("???")] + [Developer("Glatzemann, GinieDp, rene87, floAr")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Matrix : IEquatable { diff --git a/ANX.Framework/Plane.cs b/ANX.Framework/Plane.cs index c1f46d89..4f1ded63 100644 --- a/ANX.Framework/Plane.cs +++ b/ANX.Framework/Plane.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("floAr, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Plane : IEquatable { diff --git a/ANX.Framework/Point.cs b/ANX.Framework/Point.cs index 000127d3..7ccc51b7 100644 --- a/ANX.Framework/Point.cs +++ b/ANX.Framework/Point.cs @@ -9,7 +9,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("Glatzemann")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Point : IEquatable { diff --git a/ANX.Framework/Quaternion.cs b/ANX.Framework/Quaternion.cs index 767a0ef3..d994bba3 100644 --- a/ANX.Framework/Quaternion.cs +++ b/ANX.Framework/Quaternion.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("floAr, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Quaternion : IEquatable { diff --git a/ANX.Framework/Ray.cs b/ANX.Framework/Ray.cs index 422fda6f..8c86620f 100644 --- a/ANX.Framework/Ray.cs +++ b/ANX.Framework/Ray.cs @@ -8,7 +8,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("floAr")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Ray : IEquatable { diff --git a/ANX.Framework/Rectangle.cs b/ANX.Framework/Rectangle.cs index ebd1462f..c08c6142 100644 --- a/ANX.Framework/Rectangle.cs +++ b/ANX.Framework/Rectangle.cs @@ -9,7 +9,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("Glatzemann, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Rectangle : IEquatable { diff --git a/ANX.Framework/Vector2.cs b/ANX.Framework/Vector2.cs index 7d5680f1..9257b2fb 100644 --- a/ANX.Framework/Vector2.cs +++ b/ANX.Framework/Vector2.cs @@ -9,7 +9,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("xToast, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Vector2 : IEquatable { @@ -444,8 +444,7 @@ namespace ANX.Framework public override string ToString() { var culture = CultureInfo.CurrentCulture; - // This may look a bit more ugly, but String.Format should - // be avoided cause of it's bad performance! + // This may look a bit more ugly, but String.Format should be avoided cause of it's bad performance! return "{X:" + X.ToString(culture) + " Y:" + Y.ToString(culture) + "}"; } #endregion diff --git a/ANX.Framework/Vector3.cs b/ANX.Framework/Vector3.cs index 8a43bcca..407ed3d5 100644 --- a/ANX.Framework/Vector3.cs +++ b/ANX.Framework/Vector3.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("xToast, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Vector3 : IEquatable { @@ -714,8 +714,7 @@ namespace ANX.Framework public override string ToString() { var culture = CultureInfo.CurrentCulture; - // This may look a bit more ugly, but String.Format should - // be avoided cause of it's bad performance! + // This may look a bit more ugly, but String.Format should be avoided cause of it's bad performance! return "{X:" + X.ToString(culture) + " Y:" + Y.ToString(culture) + " Z:" + Z.ToString(culture) + "}"; diff --git a/ANX.Framework/Vector4.cs b/ANX.Framework/Vector4.cs index ac60eb02..a06bce53 100644 --- a/ANX.Framework/Vector4.cs +++ b/ANX.Framework/Vector4.cs @@ -12,7 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework { [PercentageComplete(100)] - [Developer("???")] + [Developer("xToast, GinieDp")] [TestState(TestStateAttribute.TestState.InProgress)] public struct Vector4 : IEquatable { @@ -597,20 +597,11 @@ namespace ANX.Framework public override string ToString() { var culture = CultureInfo.CurrentCulture; - // This may look a bit more ugly, but String.Format should - // be avoided cause of it's bad performance! + // This may look a bit more ugly, but String.Format should be avoided cause of it's bad performance! return "{X:" + X.ToString(culture) + " Y:" + Y.ToString(culture) + " Z:" + Z.ToString(culture) + " W:" + W.ToString(culture) + "}"; - - //return string.Format(culture, "{{X:{0} Y:{1} Z:{2} W:{3}}}", new object[] - //{ - // this.X.ToString(culture), - // this.Y.ToString(culture), - // this.Z.ToString(culture), - // this.W.ToString(culture) - //}); } public float Length()