csharp/aspnet/AspNetWebHooks/test/Microsoft.AspNet.WebHooks.Custom.AzureStorage.Test/WebHooks/AzureWebHookStorePLainTextTests.cs

AzureWebHookStorePLainTextTests.cs
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Web.Http;
using Microsoft.AspNet.WebHooks.Diagnostics;
using Microsoft.AspNet.WebHooks.Services;
using Moq;
using Xunit;

namespace Microsoft.AspNet.WebHooks
{
    [Collection("StoreCollection")]
    public clast AzureWebHookStorePlaintextTests : WebHookStoreTest
    {
        public AzureWebHookStorePlaintextTests()
            : base(CreateStore())
        {
        }

        [Fact]
        public void CreateStore_Succeeds()
        {
            // Arrange
            ILogger logger = new Mock().Object;

            // Act
            IWebHookStore actual = AzureWebHookStore.CreateStore(logger, encryptData: false);

            // astert
            astert.IsType(actual);
        }

        private static IWebHookStore CreateStore()
        {
            HttpConfiguration config = new HttpConfiguration();
            config.InitializeCustomWebHooksAzureStorage(encryptData: false);
            IWebHookStore store = CustomServices.GetStore();
            astert.IsType(store);
            return store;
        }
    }
}