Esempio n. 1
0
    public void Get_GetsCachedEntry()
    {
        var type          = typeof(ParameterCacheTests);
        var parameterInfo = new ParameterInfo(new List <PropertyInfo>(), new List <PropertyInfo>());

        var cache = new ParameterCache();

        cache.Set(type, parameterInfo);

        cache.Get(type).ShouldBeSameAs(parameterInfo);
    }
Esempio n. 2
0
    public void IgnoresMissingPropertyOnViewModel()
    {
        var p1 = GenerateProperty("p1");
        var p2 = GenerateProperty("p2");
        var componentProperties = new List <PropertyInfo> {
            p1.Object, p2.Object
        };

        var vmp1 = GenerateProperty("p1");
        var viewModelProperties = new List <PropertyInfo> {
            vmp1.Object
        };

        var info = new ParameterInfo(componentProperties, viewModelProperties);

        info.Parameters.ShouldNotBeNull();
        info.Parameters.Count.ShouldBe(1);
        info.Parameters.ElementAt(0).Key.ShouldBe(p1.Object);
        info.Parameters.ElementAt(0).Value.ShouldBe(vmp1.Object);
    }