コード例 #1
0
 public string ReturnMultipleReferenceParams(TestReferenceType a, TestReferenceType b)
 {
     return string.Format("{0} {1}", a.Id, b.Id);
 }
コード例 #2
0
 public TestReferenceType ReturnReferenceTypeParameter(TestReferenceType a)
 {
     return a;
 }
コード例 #3
0
 public long ReturnWithMultipleParameters(int a, long b, TestReferenceType c)
 {
     var result = a + b + c.Id;
     return result;
 }
コード例 #4
0
        public void Should_Handle_Multiple_Parameters_Mixed_Value_And_Reference_Types()
        {
            var callerInterface = GetCreatedObject();
            var refType = new TestReferenceType { Id = 3 };
            const int firstParameter = 1;
            const long secondParameter = 2L;
            var value = callerInterface.ReturnWithMultipleParameters(firstParameter, secondParameter, refType);

            Assert.That(value, Is.EqualTo(6));
        }
コード例 #5
0
        public void Should_Handle_Multiple_Reference_Parameters()
        {
            var callerInterface = GetCreatedObject();
            var param1 = new TestReferenceType { Id = 1, Name = "Test" };
            var param2 = new TestReferenceType { Id = 3, Name = "Test" };
            var result = callerInterface.ReturnMultipleReferenceParams(param1, param2);

            Assert.That(result, Is.EqualTo("1 3"));
        }
コード例 #6
0
        public void Should_Return_ReferenceType_Parameter_Given()
        {
            var callerInterface = GetCreatedObject();
            var param = new TestReferenceType {Id = 3, Name = "Test"};

            var value = callerInterface.ReturnReferenceTypeParameter(param);

            Assert.That(value.Id, Is.EqualTo(3));
            Assert.That(value.Name, Is.EqualTo("Test"));
        }