Пример #1
0
        public bool Value_Gets_Only_Been_Read_Once(NonNull <object> x, FsCheck.PositiveInt times)
        {
            IEnumerable <Maybe <object> > xs =
                Enumerable.Repeat(ReadOnce.Wrap(x.Get), times.Get)
                .Select(f => f());

            IEnumerable <Maybe <object> > ys =
                new[] { Maybe.Just(x.Get) }
            .Concat(Enumerable.Repeat(Maybe <object> .Nothing, times.Get - 1));

            return(xs.SequenceEqual(ys));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Password"/> class.
 /// </summary>
 public Password(string password)
 {
     _password = new ReadOnce <string>(password);
 }