示例#1
0
        public void SetGridPaintSortingType_CanGetComparer(Type type)
        {
            EditorPrefs.SetString(GridPaintActiveTargetsPreferences.targetSortingModeEditorPref, type.FullName);
            var comparer = GridPaintActiveTargetsPreferences.GetTargetComparer();

            Assert.NotNull(comparer);
            Assert.AreEqual(type, comparer.GetType());
        }
示例#2
0
        public void SetGridPaintSortingMethod_CanGetComparer(Type type, string methodName)
        {
            EditorPrefs.SetString(GridPaintActiveTargetsPreferences.targetSortingModeEditorPref, CombineTypeAndMethodName(type, methodName));
            var comparer = GridPaintActiveTargetsPreferences.GetTargetComparer();

            Assert.NotNull(comparer);
            Assert.AreEqual(type, comparer.GetType());
        }
示例#3
0
        public void SetCreateTileFromPalette_CanGetMethod(Type type, string methodName)
        {
            EditorPrefs.SetString(GridPaintActiveTargetsPreferences.createTileFromPaletteEditorPref, CombineTypeAndMethodName(type, methodName));
            var method        = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public);
            var paletteMethod = GridPaintActiveTargetsPreferences.GetCreateTileFromPaletteUsingPreferences();

            Assert.NotNull(paletteMethod);
            Assert.AreEqual(method, paletteMethod);
        }
示例#4
0
        public void DefaultCreateTileFromPalette_IsDefaultTile()
        {
            var method = typeof(TileUtility).GetMethod("DefaultTile", BindingFlags.Static | BindingFlags.Public);

            Assert.AreEqual(method, GridPaintActiveTargetsPreferences.GetCreateTileFromPaletteUsingPreferences());
        }
示例#5
0
 public void DefaultGridPaintSorting_IsNull()
 {
     Assert.IsNull(GridPaintActiveTargetsPreferences.GetTargetComparer());
 }