Exemplo n.º 1
0
    public void SimpleSuffixTests(string suffix, string name, bool match)
    {
        var handler = new NameHandlerBase
        {
            Suffix = suffix
        };

        var found = handler.GetNames(name).Any();

        Assert.Equal(match, found);
    }
Exemplo n.º 2
0
    public void PrefixAndSuffixTests(string prefix, string suffix, string name, int count)
    {
        var handler = new NameHandlerBase
        {
            Prefix = prefix,
            Suffix = suffix
        };

        var found = handler.GetNames(name).Count();

        Assert.Equal(count, found);
    }
Exemplo n.º 3
0
    public void MustRemovePrefixOfName()
    {
        var handler = new NameHandlerBase
        {
            Prefix = "Key"
        };

        var found = handler.GetNames("KeyTest").ToList();

        Assert.Single(found);

        Assert.Equal("Test", found.First());
    }
Exemplo n.º 4
0
    public void MustRemovePrefixAndSuffixOfName()
    {
        var handler = new NameHandlerBase
        {
            Prefix = "key",
            Suffix = "Key"
        };

        var found = handler.GetNames("KeyTestKey").ToList();

        Assert.Equal(3, found.Count);

        Assert.Equal("Test", found.Last());
    }