/// <summary>
        /// Implement this function to make a custom inspector.
        /// </summary>
        public override void OnInspectorGUI()
        {
            BDDExtensionRunner bddExtensionRunner = ((Component)target).gameObject.GetComponent <BDDExtensionRunner>();
            string             openComponentButtonTextureFullPath = Utilities.GetAssetFullPath(bddExtensionRunner, this.MainTexturePath);

            BaseBDDComponent script = (BaseBDDComponent)target;

            if (EditorApplication.isCompiling)
            {
                script.Checking = true;
            }

            BDDExtensionRunner runner = script.gameObject.GetComponent <BDDExtensionRunner>();

            if (runner != null)
            {
                this.unityInterface.EditorGUILayoutBeginHorizontal();
                Texture2D         texture = this.unityInterface.AssetDatabaseLoadAssetAtPath(openComponentButtonTextureFullPath, typeof(Texture2D));
                GUILayoutOption[] options = new GUILayoutOption[1] {
                    this.unityInterface.GUILayoutHeight(70)
                };
                GUIContent label = new GUIContent(texture);
                EditorGUILayout.LabelField(label, options);
                this.unityInterface.EditorGUILayoutEndHorizontal();
                ComponentsChecker checkForErrors = new ComponentsChecker();
                script.Errors = checkForErrors.Check(script);

                if (script.Errors.Count > 0)
                {
                    BaseBDDComponentEditorBusinessLogic businessLogic = new BaseBDDComponentEditorBusinessLogic(script);
                    businessLogic.Errors(script.Errors, this.unityInterface);
                }
                else
                {
                    this.DrawDefaultInspector();
                }

                script.Checking = false;
            }
            else
            {
                this.DrawDefaultInspector();
            }
        }
        public void Errors_Should_CallTheExpectedUnityEditorStatements_Given_OneErrorOnAComponent()
        {
            UnityTestBDDComponentBaseEditorBusinessLogicTestFirstDynamicComponent component = UnitTestUtility.CreateComponent <UnityTestBDDComponentBaseEditorBusinessLogicTestFirstDynamicComponent>();
            BDDExtensionRunner runner = UnitTestUtility.CreateComponent <BDDExtensionRunner>(component.gameObject);

            BaseBDDComponentEditorBusinessLogic unityTestBDDComponentBaseEditorBusinessLogic = new BaseBDDComponentEditorBusinessLogic(component);
            string expectedMessage          = "Message";
            List <UnityTestBDDError> errors = new List <UnityTestBDDError>();
            UnityTestBDDError        error  = new UnityTestBDDError();

            error.Message          = expectedMessage;
            error.Component        = component;
            error.MethodMethodInfo = null;
            errors.Add(error);

            string errorTextureFullPath = Utilities.GetAssetFullPath(runner, unityTestBDDComponentBaseEditorBusinessLogic.ErrorTextureFileName);
            string openComponentButtonTextureFullPath = Utilities.GetAssetFullPath(runner, unityTestBDDComponentBaseEditorBusinessLogic.OpenComponentButtonTextureFileName);

            IUnityInterfaceWrapper unityInterface = Substitute.For <IUnityInterfaceWrapper>();

            unityInterface.EditorGUIUtilityCurrentViewWidth().Returns(600f);
            float     labelWidth   = 500f;
            Texture2D inputTexture = new Texture2D(10, 10);

            unityInterface.AssetDatabaseLoadAssetAtPath(openComponentButtonTextureFullPath, typeof(Texture2D)).Returns(inputTexture);
            Texture2D errorTexture = new Texture2D(10, 10);

            unityInterface.AssetDatabaseLoadAssetAtPath(errorTextureFullPath, typeof(Texture2D)).Returns(errorTexture);

            GUILayoutOption buttonWidth = GUILayout.Width(16);

            unityInterface.GUILayoutWidth(24).Returns(buttonWidth);
            GUILayoutOption buttonHeight = GUILayout.Height(16);

            unityInterface.GUILayoutHeight(24).Returns(buttonHeight);
            GUILayoutOption[] options = new GUILayoutOption[2];
            options[0] = buttonWidth;
            options[1] = buttonHeight;
            unityInterface.GUILayoutButton(inputTexture, EditorStyles.label, options).Returns(false);
            GUILayoutOption[] errorTextureOptions = new GUILayoutOption[2];
            errorTextureOptions[0] = buttonWidth;
            errorTextureOptions[1] = buttonHeight;
            unityTestBDDComponentBaseEditorBusinessLogic.Errors(errors, unityInterface);

            Received.InOrder(() =>
            {
                unityInterface.EditorGUILayoutBeginHorizontal();
                unityInterface.EditorGUILayoutSeparator();
                unityInterface.EditorGUILayoutSeparator();
                unityInterface.EditorGUILayoutEndHorizontal();
                unityInterface.EditorGUILayoutBeginHorizontal();
                unityInterface.EditorGUIUtilityCurrentViewWidth();
                unityInterface.AssetDatabaseLoadAssetAtPath(errorTextureFullPath, typeof(Texture2D));
                unityInterface.GUILayoutWidth(24);
                unityInterface.GUILayoutHeight(24);
                unityInterface.EditorGUILayoutLabelField(errorTexture, Arg.Is <GUILayoutOption[]>(x => x.SequenceEqual(errorTextureOptions) == true));
                unityInterface.EditorGUILayoutLabelField(expectedMessage, labelWidth);
                unityInterface.AssetDatabaseLoadAssetAtPath(openComponentButtonTextureFullPath, typeof(Texture2D));
                unityInterface.GUILayoutWidth(24);
                unityInterface.GUILayoutHeight(24);
                unityInterface.GUILayoutButton(inputTexture, EditorStyles.label, Arg.Is <GUILayoutOption[]>(x => x.SequenceEqual(options) == true));
                unityInterface.EditorGUILayoutEndHorizontal();
            });
        }