public void BuoyGetSetTest() { Assert.AreEqual(_b, _ds1.Site); _b = new Site(2, "dsf", "asdf", new Contact("asdf", "asdf", "*****@*****.**", "uerh", "sadf"), new Contact("asdf", "asdf", "*****@*****.**", "uerh", "sadf"), new GPSCoords(0, 0, "arcGis")); _ds1.Site = _b; Assert.AreEqual(_b, _ds1.Site); }
/// <summary> /// Creates a new dataset with a specified start and end timestamp /// </summary> /// <param name="site">The Site that the dataset came from</param> public Dataset(Site site) { _site = site; _startTimeStamp = DateTime.MinValue; _endTimeStamp = DateTime.MinValue; _sensors = new List<Sensor>(); }
/// <summary> /// Creates a new dataset from a list of sensors. Start and end timestamp will be dynamically created /// </summary> /// <param name="site">The Site that the dataset came from</param> /// <param name="sensors">List of sensors belonging to the dataset</param> public Dataset(Site site, List<Sensor> sensors) { if (sensors == null) throw new ArgumentException("Please provide a list of sensors that belong to this site."); if (sensors.Count == 0) throw new ArgumentException("Sensor list must contain at least one sensor."); _site = site; Sensors = sensors; //To trigger setter }
public void SetUp() { _sensor1 = new Sensor("Temperature", "C"); _temperatureSensor = new Sensor("Temperature", "C"); _temperatureSensor.ErrorThreshold = 4; _contact = new Contact("Bob", "Smith", "*****@*****.**", "Bob's Bakery", "1232222"); _site = new Site(50, "Lake Rotorua", "Bob Smith", _contact, _contact, new GPSCoords(50, 50, "argis")); _dataset = new Dataset(_site, new List<Sensor> { { _sensor1 } }); }
public void SiteNoSecondaryContactReturnsZeroID() { B.SecondaryContact = null; Assert.AreEqual(0, B.SecondaryContactID); var C = new Site(Site.NextID, "Awesome Place", "Awesome", _pc, null, new GPSCoords(5, 10,"jayqon")); Assert.AreEqual(0, C.SecondaryContactID); }
public void SetUp() { _pc = new Contact("Kerry", "Arts", "*****@*****.**", "Waikato Uni", "0800 stuff"); _sc = new Contact("Steven", "McTainsh", "*****@*****.**", "CMS", "0800 WAIKATO"); _gps = new GPSCoords(37.5135426m, 6.21684m,"jayqon"); _testSite = new Site(1, "Lake Rotorua", "Chris McBride", _pc, _sc, _gps); A = new Site(6, "A Site", "David Hamilton", new Contact("David", "Hamilton", "*****@*****.**", "UoW", "1234567"), new Contact("Stan", "Smith", "*****@*****.**", "CIA", "1212127"), new GPSCoords(49, -2,"jayqon")); B = new Site(6, "A Site", "David Hamilton", new Contact("David", "Hamilton", "*****@*****.**", "UoW", "1234567"), new Contact("Stan", "Smith", "*****@*****.**", "CIA", "1212127"), new GPSCoords(49, -2,"jayqon")); }