Exemplo n.º 1
0
        public async Task GetLayoutInfo(string layoutHashId, string geometry, string expectedGeometry, bool exist)
        {
            // Arrange
            ILayoutService layoutService = new LayoutService();
            ErgodoxLayout  response      = null;

            // Act
            if (exist)
            {
                response = await layoutService.GetLayoutInfo(layoutHashId, geometry, "latest");
            }
            else
            {
                await Assert.ThrowsAsync <ArgumentException>(() => layoutService.GetLayoutInfo(layoutHashId, geometry, "latest"));
            }

            // Assert
            if (exist)
            {
                Assert.NotNull(response);
                Assert.IsType <ErgodoxLayout>(response);
                Assert.NotNull(response.Revision);
                Assert.False(string.IsNullOrWhiteSpace(response.HashId));
                Assert.False(string.IsNullOrWhiteSpace(response.Title));
                Assert.Equal(expectedGeometry, response.Geometry);
            }
        }