Exemplo n.º 1
0
    public void RouteKey_WithAdditionalAssemblies_DifferentAdditionalAssemblies()
    {
        // Arrange
        var key1 = new RouteKey(typeof(ComponentBase).Assembly, new[] { typeof(object).Assembly });
        var key2 = new RouteKey(typeof(ComponentBase).Assembly, new[] { GetType().Assembly, });

        // Act & Assert
        Assert.Equal(key1.GetHashCode(), key2.GetHashCode());
        Assert.False(key1.Equals(key2));
    }
Exemplo n.º 2
0
    public void RouteKey_WithAdditionalAssemblies()
    {
        // Arrange
        var key1 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly });
        var key2 = new RouteKey(typeof(string).Assembly, new[] { typeof(ComponentBase).Assembly, GetType().Assembly });

        // Act & Assert
        Assert.Equal(key1.GetHashCode(), key2.GetHashCode());
        Assert.True(key1.Equals(key2));
    }
Exemplo n.º 3
0
    public void RouteKey_WithNoAdditionalAssemblies_DifferentAssemblies()
    {
        // Arrange
        var key1 = new RouteKey(typeof(string).Assembly, null);
        var key2 = new RouteKey(typeof(ComponentBase).Assembly, null);

        // Act & Assert
        Assert.NotEqual(key1.GetHashCode(), key2.GetHashCode());
        Assert.False(key1.Equals(key2));
    }
Exemplo n.º 4
0
    public void RouteKey_DefaultAgainstNonDefault()
    {
        // Arrange
        var key1 = default(RouteKey);
        var key2 = new RouteKey(typeof(string).Assembly, null);

        // Act & Assert
        Assert.NotEqual(key1.GetHashCode(), key2.GetHashCode());
        Assert.False(key1.Equals(key2));
    }
Exemplo n.º 5
0
    public void RouteKey_WithNoAdditionalAssemblies_Equality()
    {
        // Arrange
        var key1 = new RouteKey(typeof(string).Assembly, null);
        var key2 = new RouteKey(typeof(string).Assembly, null);

        // Act & Assert
        Assert.Equal(key1.GetHashCode(), key2.GetHashCode());
        Assert.True(key1.Equals(key2));
    }