public async Task SetLogoShouldReturnGivenLogoAndName()
        {
            var image = this.rand.NextString();
            var type  = this.rand.NextString();
            var name  = this.rand.NextString();

            using (var mockContext = new MockHttpContext())
            {
                this.controller.ControllerContext.HttpContext = mockContext.Object;

                this.mockStorage
                .Setup(x => x.SetLogoAsync(It.IsAny <Logo>()))
                .ReturnsAsync((Logo logo) => logo);

                mockContext.Object.Request.ContentType = type;
                mockContext.SetBody(image);
                mockContext.SetHeader(Logo.NAME_HEADER, name);

                await this.controller.SetLogoAsync();

                this.mockStorage
                .Verify(x => x.SetLogoAsync(
                            It.Is <Logo>(m => m.Image == image && m.Type == type && m.Name == name && !m.IsDefault)),
                        Times.Once);

                Assert.Equal(image, mockContext.GetBody());
                Assert.Equal(type, mockContext.Object.Response.ContentType);
                Assert.Equal(name, mockContext.GetHeader(Logo.NAME_HEADER));
                Assert.Equal("False", mockContext.GetHeader(Logo.IS_DEFAULT_HEADER));
            }
        }
        public async Task SetLogoAsyncTest()
        {
            var image = this.rand.NextString();
            var type  = this.rand.NextString();

            using (var mockContext = new MockHttpContext())
            {
                this.controller.ControllerContext.HttpContext = mockContext.Object;

                this.mockStorage
                .Setup(x => x.SetLogoAsync(It.IsAny <Logo>()))
                .ReturnsAsync(new Logo
                {
                    Image = image,
                    Type  = type
                });

                mockContext.SetHeader("content-type", type);
                mockContext.SetBody(image);
                await this.controller.SetLogoAsync();

                this.mockStorage
                .Verify(x => x.SetLogoAsync(
                            It.Is <Logo>(m => m.Image == image && m.Type == type)),
                        Times.Once);

                Assert.Equal(mockContext.GetBody(), image);
                Assert.Equal(mockContext.GetHeader("content-type"), type);
            }
        }