示例#1
0
        public void AddedLabel_not_setting_addr_and_getting_should_throw()
        {
            string          key  = "Test";
            ushort          addr = 0x9F;
            LabelRepository repo = new LabelRepository();

            repo.CreateLabel(key);
            Assert.Throws <LabelAddressNotAssignedException>(() => repo.TryGetValue(key, out ushort res));
        }
示例#2
0
        public void AddedLabel_should_be_found()
        {
            string          key  = "Test";
            ushort          addr = 0x9F;
            LabelRepository repo = new LabelRepository();

            repo.CreateLabel(key);
            repo.SetAddress(key, addr);
            bool found = repo.TryGetValue(key, out var res);

            Assert.IsTrue(found);
            Assert.AreEqual(addr, res);
        }