File tree Expand file tree Collapse file tree
src/Castle.Core.Tests/DynamicProxy.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Copyright 2004-2022 Castle Project - http://www.castleproject.org/
1+ // Copyright 2004-2025 Castle Project - http://www.castleproject.org/
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- using Castle . DynamicProxy . Tests . Records ;
16-
17- using NUnit . Framework ;
18-
1915namespace Castle . DynamicProxy . Tests
2016{
17+ using Castle . DynamicProxy . Tests . Records ;
18+
19+ using NUnit . Framework ;
20+
2121 [ TestFixture ]
2222 public class RecordsTestCase : BasePEVerifyTestCase
2323 {
@@ -44,5 +44,15 @@ public void Can_proxy_record_derived_from_empty_generic_record()
4444 {
4545 _ = generator . CreateClassProxy < DerivedFromEmptyGenericRecord > ( new StandardInterceptor ( ) ) ;
4646 }
47+
48+ [ Test ]
49+ public void Cloning_a_record_proxy_yields_another_proxy_of_the_same_type ( )
50+ {
51+ var proxy = generator . CreateClassProxy < EmptyRecord > ( ) ;
52+ var clonedProxy = proxy with { } ;
53+ Assert . True ( ProxyUtil . IsProxy ( clonedProxy ) ) ;
54+ Assert . AreSame ( proxy . GetType ( ) , clonedProxy . GetType ( ) ) ;
55+ }
56+
4757 }
4858}
You can’t perform that action at this time.
0 commit comments