public IEnumerator GenerateControlsIntoAWidgetViewCorrectly(int columnIndex, string controlType)
        {
            // Arrange
            SettingsControlView controlViewPrefab = ((GameObject)Resources.Load(CONTROL_VIEW_PREFAB_PATH.Replace("{controlType}", controlType))).GetComponent <SettingsControlView>();

            SettingsControlModel newControlConfig = ScriptableObject.CreateInstance <SettingsControlModel>();

            newControlConfig.title                 = $"TestControl_Col{columnIndex}";
            newControlConfig.controlPrefab         = controlViewPrefab;
            newControlConfig.controlController     = ScriptableObject.CreateInstance <SettingsControlController>();
            newControlConfig.flagsThatDeactivateMe = new List <BooleanVariable>();
            newControlConfig.flagsThatDisableMe    = new List <BooleanVariable>();
            newControlConfig.isBeta                = false;


            controlColumnsToCreate[columnIndex].controls.Add(newControlConfig);

            // Act
            widgetView.Initialize("TestWidget", widgetController, controlColumnsToCreate);
            yield return(null);

            // Assert
            widgetController.Received(1).AddControl(
                Arg.Any <ISettingsControlView>(),
                Arg.Any <SettingsControlController>(),
                Arg.Any <SettingsControlModel>());
        }
Exemplo n.º 2
0
 public void AddControl(
     ISettingsControlView newControl,
     SettingsControlController newControlController,
     SettingsControlModel controlConfig)
 {
     newControl.Initialize(controlConfig, newControlController);
     controls.Add(newControl);
 }