Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

StoreServiceTests.cs

using FluentAssertions;
using Nop.Core.Domain.Stores;
using Nop.Services.Stores;
using NUnit.Framework;

namespace Nop.Tests.Nop.Services.Tests.Stores;

[TestFixture]
public class StoreExtensionsTests : ServiceTest
{
    private IStoreService _storeService;

    [OneTimeSetUp]
    public void SetUp()
    {
        _storeService = GetService();
    }

    [Test]
    public void CanFindHostValue()
    {
        var store = new Store
        {
            Hosts = "yourstore.com, www.yourstore.com, "
        };

        _storeService.ContainsHostValue(store, null).Should().BeFalse();
        _storeService.ContainsHostValue(store, string.Empty).Should().BeFalse();
        _storeService.ContainsHostValue(store, "store.com").Should().BeFalse();
        _storeService.ContainsHostValue(store, "yourstore.com").Should().BeTrue();
        _storeService.ContainsHostValue(store, "yoursTore.com").Should().BeTrue();
        _storeService.ContainsHostValue(store, "www.yourstore.com").Should().BeTrue();
    }
}