예제 #1
0
        public void SetIdTestModelWithNoId()
        {
            var model = new MockNoIdModel()
            {
                Id = 3
            };

            var jsonApiId = new JsonApiId <MockNoIdModel>(model);
        }
예제 #2
0
        public void SetIdTestModelWithToManyIds()
        {
            var model = new MockToManyIdModel()
            {
                Id    = 3,
                IdTwo = 4
            };

            var jsonApiId = new JsonApiId <MockToManyIdModel>(model);
        }
예제 #3
0
        public void SetIdTestWithWrongValueType()
        {
            var model = new MockModel
            {
                StringValue = "StringValue",
                MockId      = 3424,
                IntValue    = 52
            };

            var jsonApiId = new JsonApiId <MockModel>(model);

            jsonApiId.Set("sesdfsd");
        }
예제 #4
0
        public void GetIdTest()
        {
            var model = new MockModel
            {
                StringValue = "StringValue",
                MockId      = 3424,
                IntValue    = 52
            };

            var jsonApiId = new JsonApiId <MockModel>(model);

            Assert.AreEqual(3424, jsonApiId.Get());
        }