public PlaceInfo Find(UnifiSta sta) { var placeInfo = new PlaceInfo(); if (sta.signal == -25) if (sta.ap_mac == "2:2:2") placeInfo.Place = PlaceEnum.TenthFloor; else placeInfo.Place = PlaceEnum.Mezzanine; else placeInfo.Place = PlaceEnum.SecondFloor; return placeInfo; }
public void FindStaByOui() { var result = UnifiStaResponseBuilder.CreateUnifiStaResponse(JsonResult); var oui = "SamsungE"; var expectedSta = new UnifiSta() { oui = oui, noise = -95, signal = -69, ap_mac = "00:27:22:f6:cf:72" }; var fulano = result.GetByOui(oui); Assert.AreEqual(expectedSta, fulano); }
public void Sta_at_10_floor_return_10_floor() { var sta = new UnifiSta() { oui = "test", noise = -95, signal = -25, ap_mac = "2:2:2" }; var staFinder = new StaFinder(new NetWorkGeoMap()); var placeInfo = staFinder.Find(sta); Assert.AreEqual(PlaceEnum.TenthFloor, placeInfo.Place); }
public void Sta_at_Mezzanine_return_Mezzanine() { var sta = new UnifiSta() { oui = "test", noise = -95, signal = -25, ap_mac = "1:1:1" }; var staFinder = new StaFinder(new NetWorkGeoMap()); var placeInfo = staFinder.Find(sta); Assert.AreEqual(PlaceEnum.Mezzanine, placeInfo.Place); }
protected bool Equals(UnifiSta other) { return string.Equals(oui, other.oui) && string.Equals(ap_mac, other.ap_mac) && noise == other.noise && signal == other.signal; }