public SatelliteDetails GetSatelliteDetailsBySatelliteName(string Satellite = null) { SatelliteRepository sRepo = new SatelliteRepository(); SatelliteDetails satelliteDetails = new SatelliteDetails(); satelliteDetails = sRepo.GetSatelliteDetailsBySatelliteName(Satellite); return(satelliteDetails); }
public SatelliteDetails GetSatelliteDetailsByName(string satelliteName = null) { SatelliteRepository srepo = new SatelliteRepository(); SatelliteDetails result = new SatelliteDetails(); result = srepo.GetSatelliteDetailsBySatelliteName(satelliteName); return(result); }
public void GetSatelliteDetailsByName_ShouldMatchtheDetailsOfaSpecificSatellite() { SatelliteDetails satellite = new SatelliteDetails(); satellite = GetSatelliteDetailsByName("AsiaSat-3S"); Assert.AreEqual(satellite.OrginOfUNRegistry, "China"); Assert.AreEqual(satellite.NORADNumber, "25657"); Assert.AreNotEqual(satellite.CountryOfOperator, "India"); }
public List <SatelliteDetails> GetSatelliteDetails(string country = null) { DataTable dt; DataTable result; List <SatelliteDetails> satelliteDetails = new List <SatelliteDetails>(); try { using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["satellite"].ToString())) { using (var cmd = conn.CreateCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = @"GetSatelliteDetails"; //dt = DataMgr.GetData(cmd); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { result = new DataTable(); da.Fill(result); } } } foreach (DataRow data in result.Rows) { SatelliteDetails satellite = new SatelliteDetails(); satellite.SatelliteName = data["SatelliteName"].ToString(); satellite.OrginOfUNRegistry = data["OrginOfUNRegistry"].ToString(); satellite.CountryOfOperator = data["CountryOfOperator"].ToString(); satellite.Users = data["Users"].ToString(); satellite.Purpose = data["Purpose"].ToString(); satellite.ClassofOrbit = data["ClassofOrbit"].ToString(); satellite.LongitudeofGEO = data["LongitudeofGEO"].ToString(); satellite.Perigee = data["Perigee"].ToString(); satellite.Apogee = data["Apogee"].ToString(); satellite.Inclination = data["Inclination"].ToString(); satellite.Period = data["Period"].ToString(); satellite.LaunchMass = data["LaunchMass"].ToString(); satellite.DryMass = data["DryMass"].ToString(); satellite.Power = data["Power"].ToString(); satellite.DateOfLaunch = data["DateOfLaunch"].ToString(); satellite.ExpectedLifetime = data["ExpectedLifetime"].ToString(); satellite.CountryofContractor = data["CountryofContractor"].ToString(); satellite.LaunchSite = data["LaunchSite"].ToString(); satellite.LaunchVehicle = data["LaunchVehicle"].ToString(); satellite.COSPARNumber = data["COSPARNumber"].ToString(); satellite.NORADNumber = data["NORADNumber"].ToString(); satelliteDetails.Add(satellite); } return(satelliteDetails); } catch (Exception) { throw; } }
public void GetSatelliteDetailsByName_ShouldNotMatchtheSatelliteDetails() { SatelliteDetails actual = new SatelliteDetails(); actual = GetSatelliteDetailsByName("AsiaSat-3S"); SatelliteDetails expected = new SatelliteDetails() { Apogee = "", ClassofOrbit = "", COSPARNumber = "", DryMass = "" }; Assert.AreNotEqual(actual, expected); }
public SatelliteDetails GetSatelliteDetailsBySatelliteName(string Satellite = null) { DataTable dt; DataTable result; try { using (SqlConnection conn = new SqlConnection()) { conn.ConnectionString = @"Data Source = (localdb)\mssqllocaldb;Initial Catalog = IRC.SATELLITE.V1.0;Integrated Security=True"; //< add name = "satellite" connectionString = "Data Source = (localdb)\mssqllocaldb;Initial Catalog = IRC.SATELLITE.V1.0;Integrated Security = True; MultipleActiveResultSets=True;Application Name = EntityFramework" providerName = "System.Data.SqlClient" /> using (var cmd = conn.CreateCommand()) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = @"GetSatelliteDetailsByName"; if (Satellite != null) { cmd.Parameters.Add(new SqlParameter("@Satellite", Satellite)); } //dt = DataMgr.GetData(cmd); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { result = new DataTable(); da.Fill(result); } } } SatelliteDetails satellite = new SatelliteDetails(); foreach (DataRow data in result.Rows) { satellite.SatelliteName = data["SatelliteName"].ToString(); satellite.OrginOfUNRegistry = data["OrginOfUNRegistry"].ToString(); satellite.CountryOfOperator = data["CountryOfOperator"].ToString(); satellite.Users = data["Users"].ToString(); satellite.Purpose = data["Purpose"].ToString(); satellite.ClassofOrbit = data["ClassofOrbit"].ToString(); satellite.LongitudeofGEO = data["LongitudeofGEO"].ToString(); satellite.Perigee = data["Perigee"].ToString(); satellite.Apogee = data["Apogee"].ToString(); satellite.Inclination = data["Inclination"].ToString(); satellite.Period = data["Period"].ToString(); satellite.LaunchMass = data["LaunchMass"].ToString(); satellite.DryMass = data["DryMass"].ToString(); satellite.Power = data["Power"].ToString(); satellite.DateOfLaunch = data["DateOfLaunch"].ToString(); satellite.ExpectedLifetime = data["ExpectedLifetime"].ToString(); satellite.CountryofContractor = data["CountryofContractor"].ToString(); satellite.LaunchSite = data["LaunchSite"].ToString(); satellite.LaunchVehicle = data["LaunchVehicle"].ToString(); satellite.COSPARNumber = data["COSPARNumber"].ToString(); satellite.NORADNumber = data["NORADNumber"].ToString(); } return(satellite); } catch (Exception) { throw; } }
bool HandleWorldViewTouchControls() { Touch[] touches = Input.touches; if (touches.Length > 0) // Make Sure There Are Touches On Screen { // Zoom Camera In Out if (touches.Length >= 2) { float distance = Vector2.Distance(touches[0].position, touches[1].position); // Fingers Moved Away From Each OTher if (distance > zoomFingerDistanceLastFrame + zoomMagnitude) { cam.UpdateZoomDistance(-distance / zoomTouchSensitivity); } else if (distance < zoomFingerDistanceLastFrame - zoomMagnitude) // Fingers Moved Closer { cam.UpdateZoomDistance(distance / zoomTouchSensitivity); } // Set it up for next frame zoomFingerDistanceLastFrame = distance; return(true); } // If Just A Press if (touches[0].phase == TouchPhase.Began) { elegibleForPress = true; initialPress = touches[0].position; } else if (Vector2.Distance(initialPress, touches[0].position) > pressElegibilitySensitivity && touches[0].position.y > Screen.height * 0.20f) // Remves the elegibility of it being a press if over a threshold { elegibleForPress = false; } else if (touches[0].phase == TouchPhase.Ended && elegibleForPress && touches[0].position.y > Screen.height * 0.20f) { Ray ray = Camera.main.ScreenPointToRay(touches[0].position); RaycastHit hit; LayerMask layerMask = (1 << LayerMask.NameToLayer("Targetable")); if (Physics.Raycast(ray, out hit, 1000f, layerMask)) { if (hit.collider != null) { cam.SetParameters(hit.collider.GetComponent <CameraParameters>()); if (hit.collider.CompareTag("Satellite")) { SatelliteDetails details = hit.collider.GetComponent <SatelliteDetails>(); missionText.text = details.MissionText; satelliteDetailsText.text = details.DetailsText; parentObject.SetActive(true); } else { parentObject.SetActive(false); } } } } // Open Left UI Panel if (touches[0].position.x <= Screen.width * leftBorderPercentage) // If Finger Is On The Left Side Of The Screen { if (touches[0].deltaPosition.magnitude > swipeMagnitude && touches[0].deltaPosition.x > 0) // If Swipe Was Strong Enough Open Menu { if (menuState == MenuState.Closed) // If Menu Is Closed Open It { lerpState = LerpState.LerpingLeftPanelIn; menuState = MenuState.LeftMenuOpen; startTime = Time.time; return(true); } } return(false); } // Open Right UI Panel if (touches[0].position.x > Screen.width * rightBorderPercentage) // If Finger Is On The Left Side Of The Screen { if (touches[0].deltaPosition.magnitude > swipeMagnitude && touches[0].deltaPosition.x < 0) // If Swipe Was Strong Enough Open Menu { if (menuState == MenuState.Closed) // If Menu Is Closed Open It { lerpState = LerpState.LerpingRightPanelIn; menuState = MenuState.RightMenuOpen; startTime = Time.time; return(true); } } return(false); } // Rotate Camera Around Object if (touches[0].position.x > Screen.width * leftBorderPercentage && touches[0].position.x <Screen.width * rightBorderPercentage && touches[0].position.y> Screen.height * 0.20f) // If Finger Is Inside External Bounds Screen { if (touches[0].deltaPosition.magnitude > swipeMagnitude) // If Swipe Was Strong Enough Open Menu { // Add Angles To Rotation Vector2 delta = touches[0].deltaPosition / rotateTouchSensitivity; cam.UpdateRotation(delta); } return(true); } } return(false); }
public void GetSatelliteDetailsByName_ShouldThrowNotFoundException() { SatelliteDetails satellite = GetSatelliteDetailsByName("ISRO2345AD"); Assert.IsNull(satellite); }