void OnEnable() { serObj = new SerializedObject(target); cls = (EnvironmentSetup)target; //fog fogHeightStart = serObj.FindProperty("FogHeightStart"); fogHeightEnd = serObj.FindProperty("FogHeightEnd"); fogEnable = serObj.FindProperty("enableFogHeight"); //ambient ambScale = serObj.FindProperty("ambientEffectScale"); ambCol = serObj.FindProperty("newAmbCol"); ambEnable = serObj.FindProperty("enableAmbient"); //wet wetVal = serObj.FindProperty("wetEffect"); wetEnable = serObj.FindProperty("enableWet"); //snow snowLevel = serObj.FindProperty("SnowLevel"); snowTex = serObj.FindProperty("SnowTex"); enableSnow = serObj.FindProperty("enableSnow"); //rain RainDisturbTex = serObj.FindProperty("rainDisturbTex"); enableRainDisturb = serObj.FindProperty("enableRainDisturb"); intervalTime = serObj.FindProperty("intervalTime"); disturbFactor = serObj.FindProperty("disturbFactor"); }
public void should_fail_if_builder_is_null() { Assert.Throws <ArgumentNullException>( () => ((IWebHostBuilder)null).ConfigureEnvironment( (EnvironmentName.Development, EnvironmentSetup .Create <NullWebHostConfigurator, NullStartupForEnvironment>()))); }
public static IWebHostBuilder CreateWebHostBuilder(string[] args) { return(new WebHostBuilder() .UseKestrel() .ConfigureEnvironment( ( EnvironmentName.Development, EnvironmentSetup.Create <DevWebHostConfigurator, DevStartup>() ), ( EnvironmentName.Production, EnvironmentSetup.Create <ProdWebHostConfigurator, ProductionStartup>() ))); }
public void SetUp() { var plane = new Plane(10, 10, new Location { X = 0, Y = 0 }); var robot1 = new Robot(plane); robot1.Location = new Location { X = 1, Y = 2 }; robot1.Orientation = OrientationPosition.Orientation.N; var robot2 = new Robot(plane); robot2.Location = new Location { X = 3, Y = 3 }; robot2.Orientation = OrientationPosition.Orientation.E; var robot3 = new Robot(plane); robot3.Location = new Location { X = 1, Y = 2 }; robot3.Orientation = OrientationPosition.Orientation.W; var robot4 = new Robot(plane); robot4.Location = new Location { X = 5, Y = 3 }; robot4.Orientation = OrientationPosition.Orientation.S; _controller = new RobotController(plane); var Robots = new List <Robot>(); Robots.Add(robot1); Robots.Add(robot2); Robots.Add(robot3); Robots.Add(robot4); _controller.Robots = Robots.ToArray(); _streamInstance = new StreamReadWriteInstance(); _streamInstance.TextReader = new FakeStreamReader(); _streamInstance.TextWriter = new FakeStreamWriter(); _environment = new EnvironmentSetup(_controller, plane, Robots, _streamInstance); }
public void should_call_different_startup_for_specific_environment_using_type( string environmentName, string selectedStartup) { var recorder = new SimpleRecorder(); new WebHostBuilder().UseEnvironment(environmentName) .ConfigureServices(s => s.AddSingleton(recorder)) .ConfigureEnvironment ( ("Development", EnvironmentSetup.Create <NullWebHostConfigurator, DevStartup>()), ("Production", EnvironmentSetup.Create <NullWebHostConfigurator, ProdStartup>()) ) .Build(); Assert.Equal( new[] { $"{selectedStartup}.ConfigureServices" }, recorder.Records); }
public static void Initialize() { try { // This method is called by the ASP.NET infrastructure using a PreApplicationStartMethodAttribute. LogRotation.Rotate(); Log.Filename = "WebMediaPortal.log"; Log.ConsoleLogging = false; Log.TraceLogging = false; Log.Setup(); Log.Debug("WebMediaPortal starting!"); Installation.Load(MPExtendedProduct.WebMediaPortal); EnvironmentSetup.SetupEnvironment(); InitializeExtensions(); } catch (Exception ex) { // TODO: Make sure this gets logged somewhere even if we haven't setup logging yet Log.Fatal("Application initialization failed", ex); } }
//Assumptions: Robots are entered dynamically during run time. //Otherwise I would need to read all input from a File. //This is a decision I made as there is no mention of how the input would stream into the program, so I can //assume it is coming from the keyboard dynamically. That is at Runtime. static void Main(string[] args) { Console.Out.WriteLine("Enter the X and Y cordinates of the Plane"); var xyCord = Console.In.ReadLine(); var xyStrings = xyCord.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (xyStrings.Length != 2) { throw new ArgumentException("You need to enter 2 integers"); } var x = 0; var y = 0; Int32.TryParse(xyStrings[0], out x); Int32.TryParse(xyStrings[1], out y); if (x < 1 || y < 1) { throw new ArgumentException("Plane should have positive greater than 0 values"); } var plane = new Plane(x, y, new Location { X = 0, Y = 0 }); var controller = new RobotController(plane); var robots = new List <Robot>(); var inputOutputInstance = new StreamReadWriteInstance(); inputOutputInstance.TextReader = Console.In; inputOutputInstance.TextWriter = Console.Out; var environmentSetup = new EnvironmentSetup(controller, plane, robots, inputOutputInstance); environmentSetup.Execute(); }