예제 #1
0
        private void Button_Click_Find(object sender, RoutedEventArgs e)
        {
            uint value = 0;

            if (uint.TryParse(this.inputValue.Text, out value))
            {
                this.CurrentMember = MemberFactory.Find(value);
            }
            //var p = new Logic.Payment{Member = m, Sum = 40, DateTime = DateTime.Now} ;
            //MemberFactory.SaveSum(p);
        }
        public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options)
        {
            if (expectationPath.IsEquivalentTo(expectedMember.PathAndName))
            {
                var member = MemberFactory.Find(subject, subjectPath.MemberName, expectedMember.Type, parent);
                if (member is null)
                {
                    throw new ArgumentException(
                              $"Subject of type {subject?.GetType().Name} does not have member {subjectPath.MemberName}");
                }

                return(member);
            }

            return(null);
        }
예제 #3
0
        public IMember Match(IMember expectedMember, object subject, INode parent, IEquivalencyAssertionOptions options)
        {
            if (parent.Type.IsSameOrInherits(typeof(TExpectation)) && subject is TSubject)
            {
                if (expectedMember.Name == expectationMemberName)
                {
                    var member = MemberFactory.Find(subject, subjectMemberName, expectedMember.Type, parent);
                    if (member is null)
                    {
                        throw new ArgumentException(
                                  $"Subject of type {typeof(TSubject)} does not have member {subjectMemberName}");
                    }

                    return(member);
                }
            }

            return(null);
        }