// Use this for initialization void Start() { gameEngine = new MyEngine(); var dialog = gameEngine.InstallGameSystem <DialogSystem>(); dialog.Init(); }
public EngineRoutesSteps(TestWebApplicationFactory factory) { var engine = new MyEngine { //Id = "6048d0b57757e1f98eb48273", Id = new ObjectId(timestamp: 1617721631, machine: 7894647, pid: 13311, increment: 5403081), /*, creationTime: "2021-04-06T15:07:11Z"*/ Code = 16, Name = "Beuate", IsEnable = true, SearchText = "string", Scopes = new List <Scope> { new Scope { ScopeId = 2, Name = "string", Order = 0, IsEnable = true } }, InputFields = new List <InputField> { new InputField { InputId = 1, IsEnable = true, IsMandatory = true, Label = "string", Order = 0, Type = "string", Parameters = new List <Parameter> { new Parameter { ScopeParameterId = 1, ExternalCodeId = 0, Order = 0, Label = "string" } } } }, BackGroundImages = new List <BackGroundImage> { new BackGroundImage { Alt = "string", IsEnable = true, OpenInNewTab = true, Order = 0, UrlImageDesktop = "string", UrlLinkDesktop = "string", UrlImageMobile = "string", UrlLinkMobile = "string" } }, Logo = new List <Logo> { new Logo { UrlImageDesktop = "string", UrlLinkDesktop = "string", UrlImageMobile = "string", UrlLinkMobile = "string", Alt = "string", IsEnable = true, OpenInNewTab = true } }, MarketingText = new List <MarketingText> { new MarketingText { IsEnable = true, Text = "string" } } }; _engineReadRepository.Setup(r => r.CreateEngine(engine)).Returns(_inMemoryEngineReadRepository.CreateEngine(engine)); _engineReadRepository.Setup(r => r.GetEngineById(It.IsIn(16))).Returns(_inMemoryEngineReadRepository.GetEngineById(16)); _engineReadRepository.Setup(r => r.GetEngines()).Returns(_inMemoryEngineReadRepository.GetEngines()); _engineReadRepository.Setup(r => r.DeleteEngine(It.IsIn(16))).Returns(_inMemoryEngineReadRepository.DeleteEngine(16)); _engineReadRepository.Setup(r => r.UpdateEngine(It.IsIn(16), engine)).Returns(_inMemoryEngineReadRepository.UpdateEngine(16, engine)); _factory = factory.WithWebHostBuilder( builder => builder.ConfigureTestServices( services => { services.AddScoped(ser => _engineReadRepository); services.AddScoped(ser => _engineReadRepository.Object); })); _client = _factory.CreateClient(); }
public void Check1() { var sut = new MyEngine(25); int res = sut.Evaluate("deniz"); Assert.Equal(25, res); }
public void OddBehaviourWhenMarcel() { var sut = new MyEngine(50); int res = sut.Evaluate("marcel"); Assert.Equal(10, res); }
public void Check() { // NOTE - here there is nothing to Mock!! :) var sut = new MyEngine(25); int res = sut.Evaluate("deniz"); Assert.Equal(25, res); }
public async Task ThenTheReturnedBodyShouldBeGetEngine_Json(string jsonFile) { JObject actuelData = JObject.Parse(await _response.Content.ReadAsStringAsync().ConfigureAwait(false)); MyEngine fullEngineResponse = JsonConvert.DeserializeObject <MyEngine>(actuelData.ToString()); MyEngine engine = JsonConvert.DeserializeObject <MyEngine>(File.ReadAllText(jsonFile)); Assert.Equal(engine.Code, fullEngineResponse.Code); Assert.Equal(engine.Name, fullEngineResponse.Name); Assert.Equal(engine.IsEnable, fullEngineResponse.IsEnable); }
public override string ToString() { StringBuilder vehicleStr = new StringBuilder(string.Format( "License number:{0}{1}Model: {2}{1}", LicenseNum, Environment.NewLine, Model)); for (int i = 0; i < Wheels.Count; i++) { vehicleStr.AppendLine(string.Format("Wheel {0}: ", (i + 1).ToString())); vehicleStr.Append(Wheels[i].ToString()); } vehicleStr.Append(MyEngine.ToString()); vehicleStr.AppendLine(string.Format("({0:P})", EnergyLeftInPercents)); return(vehicleStr.ToString()); }
public void Execute(string executable, string[] args) { try { var assembly = Assembly.LoadFrom(executable); var engine = new MyEngine(); var envVars = MyEngine.EnvironmentVars; var testClassName = envVars.TestClass; var unitTestName = envVars.UnitTestName; var mco = SetOptions(envVars); var main = new ChessMain(mco, assembly, testClassName, unitTestName); Environment.Exit(0); } catch (Exception e) { Console.WriteLine(e.Message); Environment.Exit((int)ChessExitCode.ChessFailure); } }
public WindowPrimary() : base(Gtk.WindowType.Toplevel) { Build(); SetDefaultSize(250, 200); SetPosition(WindowPosition.Center); /* * if (Platform.Instance.IsTraySupported ()) { * notifyIcon = new StatusIcon (GuiUtils.LoadImageFromResource("icon.png")); * * notifyIcon.Visible = true; * * // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked. * notifyIcon.Activate += OnNotifyIconActivate; * // Show a pop up menu when the icon has been right clicked. * notifyIcon.PopupMenu += OnNotifyIconPopup; * * // A Tooltip for the Icon * notifyIcon.Tooltip = "Hello World Icon"; * } */ webBrowser = new WebView(); webBrowser.Editable = false; webBrowser.Open("http://localhost:4649"); pnlMain.Add(webBrowser); //Gtk.Box.BoxChild w = ((Gtk.Box.BoxChild)pnlMain [webBrowser]); //w.Position = 0; //w.Expand = true; //w.Fill = true; pnlMain.ShowAll(); DeleteEvent += delegate(object o, Gtk.DeleteEventArgs args) { if (CanClose) { return; } MyEngine.RequestStop(); }; }
public static void Main() { MyEngine engine = new MyEngine(); engine.Run(); }
public static void Main() { Engine engine = new MyEngine(); engine.Run(); }
public virtual bool TryAssignMember(int i_NumOfField, string i_InputStr, out string o_ErrorMsg) { bool isMemberValid = false; int indexOfWheelBasedOnField = i_NumOfField; o_ErrorMsg = null; i_NumOfField = GetIndexOfWheelToValidate(i_NumOfField, ref indexOfWheelBasedOnField); switch (i_NumOfField) { case 0: isMemberValid = IsModelValid(i_InputStr); if (isMemberValid == true) { Model = i_InputStr; } else { o_ErrorMsg = "The model must contain letters or digits only"; } break; case 1: isMemberValid = float.TryParse(i_InputStr, out float amountOfMaterial) == true?r_Engine.IsAmountsOfSourcePowerMaterialValid(amountOfMaterial) : false; if (isMemberValid == true) { MyEngine.InitializeAmountOfEnergy(amountOfMaterial, this); } else { o_ErrorMsg = string.Format( "The value must be positive and below {0}", r_Engine.GetAmountOfSourcePowerMaterialPossible().ToString()); } break; case 2: isMemberValid = Wheels[indexOfWheelBasedOnField].IsManufacturerValid(i_InputStr); if (isMemberValid == true) { Wheels[indexOfWheelBasedOnField].Manufacturor = i_InputStr; } else { o_ErrorMsg = "The value must contain letter only"; } break; case 3: isMemberValid = float.TryParse(i_InputStr, out float o_AirPressure) == true ? Wheels[indexOfWheelBasedOnField].IsAirPressureIsValid(o_AirPressure) : false; if (isMemberValid == true) { Wheels[indexOfWheelBasedOnField].Inflate(o_AirPressure); } else { o_ErrorMsg = string.Format( "The value must be positive and below {0}", Wheels[indexOfWheelBasedOnField].GetAmountOfPressurePossibleToInflate().ToString()); } break; } return(isMemberValid); }
public NearbyForm(MyEngine mainForm, AxMapControl mapControl) { InitializeComponent(); this.mainForm = mainForm; this.mapControl = mapControl; }