﻿namespace Dike.Core.Test.Application.Features
{
    using System.Diagnostics.CodeAnalysis;
    using System.Threading.Tasks;
    using Xunit;

    /// <summary>
    /// Unit test for the <see cref="Core.Application.Features.EmptyFeatureValueStore"/> class.
    /// </summary>
    [ExcludeFromCodeCoverage]
    public class EmptyFeatureValueStoreTest
    {
        #region Methods

        /// <summary>
        /// Unit test of the singleton instance.
        /// </summary>
        /// <returns>A task that represents the asynchronous operation.</returns>
        [Fact]
        public async Task Instance_Should_Be_Valid()
        {
            Core.Application.Features.EmptyFeatureValueStore store = Core.Application.Features.EmptyFeatureValueStore.Instance;

            string result = await store.GetValueOrNullAsync(1, new Core.Application.Features.Feature("Test", "DefaultValue")).ConfigureAwait(false);
            Assert.Null(result);
        }

        /// <summary>
        /// Unit test of the singleton pattern.
        /// </summary>
        [Fact]
        public void Instance_Should_Returns_Singleton()
        {
            Assert.Equal(Core.Application.Features.EmptyFeatureValueStore.Instance, Core.Application.Features.EmptyFeatureValueStore.Instance);
        }

        #endregion Methods
    }
}