コード例 #1
0
 public void PrintToString_WhenTakeOnlySerial()
 {
     _class = new ClassWithField {
         StrField = "String"
     };
     _class.PrintToString(ser => ser.AlternativeFor <string>().TakeOnly(1)).Should().NotContain(_class.StrField)
     .And.Contain(_class.StrField[0].ToString());
 }
コード例 #2
0
        public void PrintToString_WhenAlternativeCultureSerial(string culture, double height, string expectHeight)
        {
            var _class = new ClassWithField {
                DoublField = height
            };
            var result = _class.PrintToString(ser => ser.AlternativeFor <double>().Using(new CultureInfo(culture)));

            result.Should().Contain(expectHeight);
        }
コード例 #3
0
        public void PrintToString_WhenTakeOnlySerialWithNullOrEmpty(string str)
        {
            _class = new ClassWithField {
                StrField = str
            };
            var result = _class.PrintToString(ser => ser.AlternativeFor <string>().TakeOnly(1));

            result.Should().Contain(nameof(_class.StrField));
        }
コード例 #4
0
        public void PrintToString_WhenPersonWithArgument_ShouldContainValueAfterName()
        {
            _class = new ClassWithField {
                StrField = "Value"
            };
            var result = _class.PrintToString();

            IsValueAfterName(nameof(_class.StrField), _class.StrField, result).Should().BeTrue();
        }
コード例 #5
0
 public void PrintToString_WhenField()
 {
     _class.PrintToString().Should().Contain(nameof(_class.IntField)).And.Contain(nameof(_class.DoublField)).And
     .Contain(nameof(_class.StrField));
 }