예제 #1
0
파일: HalTests.cs 프로젝트: amogram/hallo
        public void EmbedsResourceInRepresentation()
        {
            var representation = new EmbeddedRepresentation();
            var resource       = new ResourceModel
            {
                A = 1,
                B = 2,
                C = 3
            };

            var hal = ((IHal)representation).RepresentationOf(resource);

            hal.Embedded.Should().BeEquivalentTo(new
            {
                D = 123
            });
        }
예제 #2
0
        public async Task RepresentationOf_EmbedsResourceInRepresentation()
        {
            var representation = new EmbeddedRepresentation();
            var resource       = new ResourceModel
            {
                A = 1,
                B = 2,
                C = 3
            };

            var hal = await((IHal)representation).RepresentationOfAsync(resource);

            hal.Embedded.Should().BeEquivalentTo(new
            {
                D = 123
            });
        }