当前位置: 首页>>代码示例>>C#>>正文


C# PropertyHolder.GetType方法代码示例

本文整理汇总了C#中PropertyHolder.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyHolder.GetType方法的具体用法?C# PropertyHolder.GetType怎么用?C# PropertyHolder.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyHolder的用法示例。


在下文中一共展示了PropertyHolder.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SutIsGuardClauseCommand

 public void SutIsGuardClauseCommand()
 {
     // Fixture setup
     var dummyOwner = new PropertyHolder<object>();
     var dummyProperty = dummyOwner.GetType().GetProperty("Property");
     // Exercise system
     var sut = new PropertySetCommand(dummyProperty, dummyOwner);
     // Verify outcome
     Assert.IsAssignableFrom<IGuardClauseCommand>(sut);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:11,代码来源:PropertySetCommandTest.cs

示例2: RequestedTypeIsCorrect

 public void RequestedTypeIsCorrect()
 {
     // Fixture setup
     var dummyOwner = new PropertyHolder<Version>();
     var property = dummyOwner.GetType().GetProperty("Property");
     var sut = new PropertySetCommand(property, dummyOwner);
     // Exercise system
     var result = sut.RequestedType;
     // Verify outcome
     Assert.Equal(property.PropertyType, result);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:PropertySetCommandTest.cs

示例3: OwnerIsCorrect

 public void OwnerIsCorrect()
 {
     // Fixture setup
     var owner = new PropertyHolder<object>();
     var dummyProperty = owner.GetType().GetProperty("Property");
     var sut = new PropertySetCommand(dummyProperty, owner);
     // Exercise system
     var result = sut.Owner;
     // Verify outcome
     Assert.Equal(owner, result);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:PropertySetCommandTest.cs

示例4: PropertyInfoIsCorrect

 public void PropertyInfoIsCorrect()
 {
     // Fixture setup
     var dummyOwner = new PropertyHolder<object>();
     var propertyInfo = dummyOwner.GetType().GetProperty("Property");
     var sut = new PropertySetCommand(propertyInfo, dummyOwner);
     // Exercise system
     PropertyInfo result = sut.PropertyInfo;
     // Verify outcome
     Assert.Equal(propertyInfo, result);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:12,代码来源:PropertySetCommandTest.cs

示例5: ExecuteAssignsValueToOwnerProperty

 public void ExecuteAssignsValueToOwnerProperty()
 {
     // Fixture setup
     var owner = new PropertyHolder<object>();
     var property = owner.GetType().GetProperty("Property");
     var sut = new PropertySetCommand(property, owner);
     var value = new object();
     // Exercise system
     sut.Execute(value);
     // Verify outcome
     Assert.Equal(value, owner.Property);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:13,代码来源:PropertySetCommandTest.cs

示例6: CreateExceptionReturnsExceptionWithCorrectMessage

 public void CreateExceptionReturnsExceptionWithCorrectMessage()
 {
     // Fixture setup
     var dummyOwner = new PropertyHolder<Version>();
     var dummyProperty = dummyOwner.GetType().GetProperty("Property");
     var sut = new PropertySetCommand(dummyProperty, dummyOwner);
     // Exercise system
     var message = Guid.NewGuid().ToString();
     var result = sut.CreateException(message);
     // Verify outcome
     var e = Assert.IsAssignableFrom<GuardClauseException>(result);
     Assert.Contains(message, e.Message);
     // Teardown
 }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:14,代码来源:PropertySetCommandTest.cs

示例7: ExecuteOnNonGenericWillAssignProperty

        public void ExecuteOnNonGenericWillAssignProperty()
        {
            // Fixture setup
            var specimen = new PropertyHolder<object>();
            var sut = new AutoPropertiesCommand(specimen.GetType());

            var expectedPropertyValue = new object();
            var container = new DelegatingSpecimenContext { OnResolve = r => expectedPropertyValue };
            // Exercise system
            sut.Execute(specimen, container);
            // Verify outcome
            Assert.Equal(expectedPropertyValue, specimen.Property);
            // Teardown
        }
开发者ID:RyanLiu99,项目名称:AutoFixture,代码行数:14,代码来源:AutoPropertiesCommandTest.cs


注:本文中的PropertyHolder.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。