Exemple #1
0
        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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 protected bool Equals(UnifiSta other)
 {
     return string.Equals(oui, other.oui) && string.Equals(ap_mac, other.ap_mac) && noise == other.noise && signal == other.signal;
 }