Ejemplo n.º 1
0
        public void AunnCoo_Object_For_GenericNotEqualToken_And_ShouldBeValid()
        {
            var model = new AunnCoo {
                OtherInfo = Haha
            };

            var context  = VerifiableObjectContractManager.Resolve <AunnCoo>().WithInstance(model);
            var member   = context.GetValue("OtherInfo");
            var contract = member.ExposeContract();

            var token = new ValueNotEqualToken <object>(contract, Hoho, null);

            token.Valid(context).IsSuccess.ShouldBeTrue();
            token.Valid(member).IsSuccess.ShouldBeTrue();
        }
Ejemplo n.º 2
0
        public void AunnCoo_ValueType_For_NotEqualToken_And_ShouldBeInvalid()
        {
            var model = new AunnCoo {
                Age = 10
            };

            var context  = VerifiableObjectContractManager.Resolve <AunnCoo>().WithInstance(model);
            var member   = context.GetValue("Age");
            var contract = member.ExposeContract();

            var token = new ValueNotEqualToken(contract, 10, null);

            token.Valid(context).IsSuccess.ShouldBeFalse();
            token.Valid(member).IsSuccess.ShouldBeFalse();
        }