Пример #1
0
        public void DataObject_CanBeRetrievedByString()
        {
            var guid           = new Guid("AB37A611-B7F4-4EE8-AE2F-D32FB2D0D151");
            var distractorguid = new Guid("00000000-B7F4-4EE8-AE2F-D32FB2D0D151");

            var str = "retrieval string";
            var o   = new SimpleDataObject()
            {
                BooleanValue = true,
                DoubleValue  = 12,
                Int32Value   = 24,
                GuidValue    = guid,
                StringValue  = str
            };

            o.Save();

            var distractor = new SimpleDataObject()
            {
                GuidValue = distractorguid
            };

            distractor.Save();

            var test = SimpleDataObject.Get(new SimpleDataObject()
            {
                StringValue = str
            });

            Assert.AreEqual(1, test.Count);
            AssertFullMatch(o, test[0]);
        }
Пример #2
0
        public void DataObject_CanBeSavedAndRetrievedById()
        {
            var guid           = new Guid("AA37A611-B7F4-4EE8-AE2F-D32FB2D0D151");
            var distractorguid = new Guid("00000000-B7F4-4EE8-AE2F-D32FB2D0D151");

            var o = new SimpleDataObject()
            {
                BooleanValue = true,
                DoubleValue  = 32,
                Int32Value   = 64,
                GuidValue    = guid,
                StringValue  = "a string"
            };

            o.Save();

            var distractor = new SimpleDataObject()
            {
                GuidValue = distractorguid
            };

            distractor.Save();

            var test = SimpleDataObject.Get(guid);

            AssertFullMatch(o, test);
        }