Exemplo n.º 1
0
        public void AssignAsToStringCall_Call_ReturnsValidPropertyAssignment()
        {
            Recorder recorder = new Recorder();

            recorder.AppendAssignment(Assign.AsToStringCall, Context);

            Assignment assignment = recorder.ToAssignment();

            string expected = "{1}.P2 = {0}.P1.ToString();\r\n";

            Assert.AreEqual(expected, assignment.RelativeTemplate);
        }
Exemplo n.º 2
0
        public void AssignAsStringToValueTypeConvert_Call_ReturnsValidPropertyAssignment()
        {
            Recorder recorder = new Recorder();

            recorder.AppendAssignment(Assign.AsStringToValueTypeConvert, Context);

            Assignment assignment = recorder.ToAssignment();

            string expected = "{1}.P2 = (ulong) Convert.ChangeType({0}.P1, typeof(ulong));\r\n";

            Assert.AreEqual(expected, assignment.RelativeTemplate);
        }