void Awake() { if (_self != null) Destroy(this); _self = this; DontDestroyOnLoad(this.gameObject); }
void Awake () { data = GetComponent<SetupData>(); localIDToPlayerID = new int[possiblePlayers.Length]; for (int i = 0; i < localIDToPlayerID.Length; i++) localIDToPlayerID[i] = -1; registrationMusic = GameObject.Find("BackGroundMusic").GetComponent<AudioSource>(); }
public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode) { _channels.Clear(); _channels.AddRange(executableObject.FullChannels); _setupNode = setupNode; if (_setupNode.SelectSingleNode("Settings") == null) { Xml.GetNodeAlways(_setupNode, "Settings"); } }
private void ThenReturnSumOfSessionPrices(ApiResponse response, SetupData setup) { var price = AssertSuccessResponse <decimal>(response); Assert.That(price, Is.EqualTo(50 + 50 + 75)); }
void Awake() { Assert.IsTrue(Time.timeScale == 1); if (Time.timeScale != 1) { Pause.unPause(); } data = GetComponent<SetupData>(); buttonSound = GetComponent<AudioController>(); localIDToPlayerID = new int[possiblePlayers.Length]; for (int i = 0; i < localIDToPlayerID.Length; i++) localIDToPlayerID[i] = -1; joystickEdgeTriggers = new Vector2[possiblePlayers.Length]; for (int i = 0; i < joystickEdgeTriggers.Length; i++) joystickEdgeTriggers[i] = Vector2.zero; joystickEdgeTriggersXY = new Vector2[possiblePlayers.Length]; for (int i = 0; i < joystickEdgeTriggersXY.Length; i++) joystickEdgeTriggersXY[i] = Vector2.zero; pressedTimes = new float[possiblePlayers.Length]; for (int i = 0; i < pressedTimes.Length; i++) pressedTimes[i] = 0; pressStart = GetComponentInChildren<Canvas>().gameObject; pressStart.SetActive(false); }
private void PluginListDialog() { var executableObject = _contextProfile; _setupData = executableObject.PlugInData; _executableObject = executableObject; Cursor = Cursors.WaitCursor; List<IHardwarePlugin> hardwarePlugins; try { hardwarePlugins = OutputPlugins.LoadPlugins(); OutputPlugins.VerifyPlugIns(_executableObject); } finally { Cursor = Cursors.Default; } _channels = executableObject.Channels; _sequencePlugins = new List<IHardwarePlugin>(); if (cbAvailablePlugIns.Items.Count > 0 || null == hardwarePlugins) { return; } cbAvailablePlugIns.Items.Clear(); cbAvailablePlugIns.Items.Add("Please select a plug in to add"); foreach (var plugin in hardwarePlugins) { cbAvailablePlugIns.Items.Add(plugin.Name); } cbAvailablePlugIns.SelectedIndex = 0; }
private ApiResponse WhenTryUpdateBusinessAnonymously(ApiBusinessSaveCommand command, SetupData setup) { var json = JsonSerialiser.Serialise(command); return(WhenTryUpdateBusinessAnonymously(json, setup)); }
private ApiBusinessSaveCommand GivenIsOnlinePaymentEnabledButNoPaymentProvider(SetupData setup) { return(new ApiBusinessSaveCommand { name = setup.Business.Name, domain = setup.Business.Domain, sport = setup.Business.Sport, payment = new ApiBusinessPaymentOptions { currency = "EUR", isOnlinePaymentEnabled = true, forceOnlinePayment = false, merchantAccountIdentifier = "*****@*****.**" } }); }
private void ThenReturnsDuplicateSubdomainError(ApiResponse response, ApiBusinessSaveCommand command, SetupData setup) { AssertSingleError(response, ErrorCodes.SubdomainDuplicate, string.Format("The subdomain '{0}' already exists.", command.domain), command.domain); }
private void ThenUpdateTheBusinessWithChanges(ApiResponse response, ApiBusinessSaveCommand command, SetupData setup) { var responseBusiness = AssertSuccessResponse <BusinessData>(response); Assert.That(responseBusiness.id, Is.EqualTo(setup.Business.Id)); Assert.That(responseBusiness.name, Is.EqualTo(command.name)); Assert.That(responseBusiness.domain, Is.EqualTo(command.domain.ToLowerInvariant())); Assert.That(responseBusiness.sport, Is.EqualTo(command.sport)); Assert.That(responseBusiness.payment.currency, Is.EqualTo(command.payment.currency)); Assert.That(responseBusiness.payment.isOnlinePaymentEnabled, Is.EqualTo(command.payment.isOnlinePaymentEnabled)); Assert.That(responseBusiness.payment.forceOnlinePayment, Is.EqualTo(command.payment.forceOnlinePayment)); Assert.That(responseBusiness.payment.paymentProvider, Is.EqualTo(command.payment.paymentProvider)); Assert.That(responseBusiness.payment.merchantAccountIdentifier, Is.EqualTo(command.payment.merchantAccountIdentifier)); var getResponse = AuthenticatedGet <BusinessData>("Business", setup); var getBusiness = (BusinessData)getResponse.Payload; Assert.That(getBusiness.id, Is.EqualTo(setup.Business.Id)); Assert.That(getBusiness.name, Is.EqualTo(command.name)); Assert.That(getBusiness.domain, Is.EqualTo(command.domain.ToLowerInvariant())); Assert.That(getBusiness.sport, Is.EqualTo(command.sport)); Assert.That(getBusiness.payment.currency, Is.EqualTo(command.payment.currency)); Assert.That(getBusiness.payment.isOnlinePaymentEnabled, Is.EqualTo(command.payment.isOnlinePaymentEnabled)); Assert.That(getBusiness.payment.forceOnlinePayment, Is.EqualTo(command.payment.forceOnlinePayment)); Assert.That(getBusiness.payment.paymentProvider, Is.EqualTo(command.payment.paymentProvider)); Assert.That(getBusiness.payment.merchantAccountIdentifier, Is.EqualTo(command.payment.merchantAccountIdentifier)); }
private ApiBusinessSaveCommand GivenInvalidMerchantAccountIdentifierFormat(SetupData setup) { var command = CreateValidBusinessSaveCommand(setup); command.payment.merchantAccountIdentifier = "abc123"; return(command); }
private ApiBusinessSaveCommand GivenValidBusinessSaveCommandWithOnlinePaymentOn(SetupData setup) { var command = CreateValidBusinessSaveCommand(setup); command.payment.isOnlinePaymentEnabled = true; return(command); }
private void ThenReturnCoursePrice(ApiResponse response, SetupData setup) { var price = AssertSuccessResponse <decimal>(response); Assert.That(price, Is.EqualTo(120m)); }
/// <summary> /// The shutdown. /// </summary> public void Shutdown() { if (this._displayVisualizer != null) { if (this._displayVisualizer.InvokeRequired) { this._displayVisualizer.BeginInvoke(new MethodInvoker(this._displayVisualizer.Dispose)); } else { this._displayVisualizer.Dispose(); } this._displayVisualizer = null; } this._channels.Clear(); this._setupData = null; this._setupNode = null; }
private ApiResponse WhenTryGetPrice(ApiPriceGetCommand command, SetupData setup) { var json = JsonSerialiser.Serialise(command); return(BusinessAnonymousPost <decimal>(json, RelativePath, setup)); }
private void UpdateSessionPriceOfLastSessionOfAaronOrakeiHolidayCamp9To15For3Days(SetupData setup) { var command = new ApiSessionSaveCommand(setup.AaronOrakeiHolidayCamp9To15For3Days.Sessions[2]) { id = setup.AaronOrakeiHolidayCamp9To15For3Days.Sessions[2].Id, pricing = { sessionPrice = 75 } }; PostSession(JsonSerialiser.Serialise(command), setup); }
private Guid GivenValidLocationId(SetupData setup) { return(setup.Remuera.Id); }
public TideSiteControllerTest() { setupData = new SetupData(); }
public TVItemControllerTest() { setupData = new SetupData(); }
private SessionData ThenSelfClashingSessionWillBeUpdated(ApiResponse response, SetupData setup) { var session = AssertSuccessResponse <SessionData>(response); Assert.That(session, Is.Not.Null); Assert.That(session.parentId, Is.Null); Assert.That(session.id, Is.EqualTo(setup.AaronOrakeiMiniRed14To15.Id)); AssertSessionLocation(session.location, setup.Orakei.Id, setup.Orakei.Name); AssertSessionCoach(session.coach, setup.Aaron.Id, setup.Aaron.Name); AssertSessionService(session.service, setup.MiniRed.Id, setup.MiniRed.Name); AssertSessionTiming(session.timing, GetDateFormatNumberOfDaysOut(21), "14:30", 60); AssertSessionBooking(session.booking, 3, true); AssertSessionRepetition(session.repetition, 1, null); AssertSessionPricing(session.pricing, 19.95m, null); AssertSessionPresentation(session.presentation, "red"); return(session); }
private void ThenReturnSessionPriceTimesSessionNumber(ApiResponse response, SetupData setup) { var price = AssertSuccessResponse <decimal>(response); Assert.That(price, Is.EqualTo(2 * 50)); }
private ApiBusinessSaveCommand GivenValidBusinessSaveCommandWithoutPaymentProvider(SetupData setup) { var command = CreateValidBusinessSaveCommand(setup); command.payment = new ApiBusinessPaymentOptions { currency = "EUR", isOnlinePaymentEnabled = false }; return(command); }
public ReportServiceBoxModelTest() { setupData = new SetupData(); }
private void ThenReturnsInvalidSubdomainFormatError(ApiResponse response, ApiBusinessSaveCommand command, SetupData setup) { AssertSingleError(response, ErrorCodes.SubdomainFormatInvalid, string.Format("The subdomain '{0}' is not in a valid format.", command.domain), command.domain); }
private Guid GivenCourseWithoutBookings(SetupData setup) { RegisterCourseAaronOrakeiHolidayCamp9To15For3Days(setup); return(setup.AaronOrakeiHolidayCamp9To15For3Days.Id); }
private void ThenUpdateTheBusinessWithoutPaymentProvider(ApiResponse response, ApiBusinessSaveCommand command, SetupData setup) { var responseBusiness = AssertSuccessResponse <BusinessData>(response); Assert.That(responseBusiness.id, Is.EqualTo(setup.Business.Id)); Assert.That(responseBusiness.name, Is.EqualTo(command.name)); Assert.That(responseBusiness.domain, Is.EqualTo(setup.Business.Domain)); Assert.That(responseBusiness.sport, Is.EqualTo(setup.Business.Sport)); Assert.That(responseBusiness.payment.currency, Is.EqualTo(command.payment.currency)); Assert.That(responseBusiness.payment.paymentProvider, Is.Null); var getResponse = AuthenticatedGet <BusinessData>("Business", setup); var getBusiness = (BusinessData)getResponse.Payload; Assert.That(getBusiness.id, Is.EqualTo(setup.Business.Id)); Assert.That(getBusiness.name, Is.EqualTo(command.name)); Assert.That(getBusiness.domain, Is.EqualTo(setup.Business.Domain)); Assert.That(getBusiness.payment.currency, Is.EqualTo(command.payment.currency)); Assert.That(getBusiness.payment.paymentProvider, Is.Null); }
private ApiResponse WhenTryDeleteCourse(Guid id, SetupData setup) { return(AuthenticatedDelete(RelativePath, id.ToString(), setup)); }
private ApiResponse WhenTryUpdateBusiness(string json, SetupData setup) { return(AuthenticatedPost <BusinessData>(json, RelativePath, setup)); }
private Guid GivenValidCoachId(SetupData setup) { return(setup.Aaron.Id); }
private ApiResponse WhenTryUpdateBusinessAnonymously(string json, SetupData setup) { return(BusinessAnonymousPost <BusinessData>(json, RelativePath, setup)); }
private ApiResponse WhenTryGetAllCoaches(SetupData setup) { return(AuthenticatedGet <List <CoachData> >(RelativePath, setup)); }
private ApiSessionSaveCommand GivenNewCourseWithBothSessionPriceAndCoursePrice(SetupData setup) { var command = CreateCourseSaveCommand(setup.AaronOrakeiHolidayCamp9To15For3Days); command.timing.startDate = GetDateFormatNumberOfDaysOut(7); command.pricing = new ApiPricing { sessionPrice = 37.5m, coursePrice = 100 }; return(command); }
private ApiResponse WhenTryGetCoachById(Guid coachId, SetupData setup) { return(AuthenticatedGet <CoachData>(RelativePath, coachId, setup)); }
public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode) { // load all of our xml into working objects this.LoadSetupNodeInfo(); // find all of the network interfaces & build a sorted list indexed by Id this._nicTable = new SortedList<string, NetworkInterface>(); NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); foreach (var nic in nics) { if (nic.NetworkInterfaceType.CompareTo(NetworkInterfaceType.Tunnel) != 0) { this._nicTable.Add(nic.Id, nic); } } }
public RatingCurveServiceTest() { setupData = new SetupData(); }
public void Destruct() { _self = null; Destroy(this.gameObject); }
private ApiSessionSaveCommand GivenExistingSessionToBeUpdatedClashesWithItself(SetupData setup) { var command = CreateSessionSaveCommand(setup.AaronOrakeiMiniRed14To15); command.id = setup.AaronOrakeiMiniRed14To15.Id; command.timing.startTime = "14:30"; return(command); }
private ApiSessionSaveCommand GivenSessionClashesWithAnotherStandaloneSession(SetupData setup) { var command = CreateSessionSaveCommand(setup.AaronOrakeiMiniRed14To15); command.id = setup.AaronOrakeiMiniRed16To17.Id; command.timing.startTime = "14:30"; return(command); }
/// <summary> /// The initialize. /// </summary> /// <param name = "executableObject"> /// The executable object. /// </param> /// <param name = "setupData"> /// The setup data. /// </param> /// <param name = "setupNode"> /// The setup node. /// </param> public void Initialize(IExecutable executableObject, SetupData setupData, XmlNode setupNode) { this._channels.Clear(); this._channels.AddRange(executableObject.Channels); this._setupData = setupData; this._setupNode = setupNode; this.LoadDataFromSetupNode(); }