Пример #1
0
        public void PublicFunctions_AtomListToSearchTo()
        {
            //------------Setup for test--------------------------
            var env = CreateEnvironmentWithData();

            var lst = new List <DataStorage.WarewolfAtom>()
            {
                DataStorage.WarewolfAtom.Nothing, DataStorage.WarewolfAtom.NewPositionedValue(new Tuple <int, DataStorage.WarewolfAtom>(2, DataStorage.WarewolfAtom.NewDataString("a"))), DataStorage.WarewolfAtom.NewDataString("A")
            };
            //------------Execute Test---------------------------
            var res = PublicFunctions.AtomListToSearchTo(lst);
            var recordSetSearchPayloads = res as RecordSetSearchPayload[] ?? res.ToArray();

            Assert.AreEqual(recordSetSearchPayloads.First().Index, 0);
            Assert.AreEqual(recordSetSearchPayloads.First().Payload, null);
            Assert.AreEqual(recordSetSearchPayloads.Last().Index, 2);
            Assert.AreEqual(recordSetSearchPayloads.Last().Payload, "A");
            Assert.AreEqual(recordSetSearchPayloads[1].Index, 2);
            Assert.AreEqual(recordSetSearchPayloads[1].Payload, "a");
        }