/// <summary>
 ///     Withes the simple value.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="value">The value.</param>
 /// <returns>ClrObjectBuilder.</returns>
 public ClrObjectBuilder WithSimpleValue <T>(T value)
 {
     WithType("");
     TypeMock.Setup(type => type.HasSimpleValue).Returns(true);
     TypeMock.Setup(type => type.GetValue(It.IsAny <ulong>())).Returns(value);
     return(this);
 }
Exemple #2
0
 public InterceptInfo(TypeMock.Internal.Hooks.HookEventArgsBase e)
 {
     this.TargetInstance = e.Context;
     this.TypeName = e.TypeName;
     this.MethodName = e.MethodName;
     var parameters = e.MethodGenericParameters as TypeMock.TypeParams;
     if (parameters != null) this.GenericParams = parameters.GetTypes();
 }
Exemple #3
0
        public void TestOnEntry()
        {
            var args = TypeMock.GetMock <MethodExecutionArgs>();  // I haven't used TypeMock I don't know the syntax
            // ...arrange args...

            var ccc = new LoggingCrossCuttingConcern();

            ccc.OnEntry(args);
        }
 /// <summary>
 ///     Withes the type.
 /// </summary>
 /// <param name="typeName">Name of the type.</param>
 /// <returns>ClrObjectBuilder.</returns>
 public ClrObjectBuilder WithType(string typeName)
 {
     TypeMock.Setup(type => type.Name).Returns(typeName);
     return(this);
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ClrObjectBuilder" /> class.
 /// </summary>
 public ClrObjectBuilder()
 {
     Mock.SetupAllProperties();
     TypeMock.SetupAllProperties();
     Mock.Setup(o => o.Type).Returns(TypeMock.Object);
 }