We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I'm using the MockTable.FromType method but it crash with a "getter-only" property.
My use case:
_services.DbMocks.WhenTag("MY_TAG").ReturnsTable(MockTable.FromType(new[] { new MockedA() { MyLabel = "Mocked sample A", MyOtherLabel = "Mocked sample B" } }, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance)); class A { public string MyLabel { get; set; } = string.Empty; public string ReadOnlyLabel => MyLabel; } class MockedA : A { public string MyOtherLabel { get; set; } = string.Empty; }
The stack trace :
Message: System.ArgumentException: Property set method not found. Stack Trace: RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) DataRowConvertor.ToType[T](DataRow row) DataRow.MapTo[T]() <>c.<GetMyObjectsByProfileIds>b__28_0(DataRow row) line 1190 <>c__DisplayClass19_0`1.<ExecuteTableAsync>b__1(DataRow row) SelectArrayIterator`2.MoveNext() Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found) Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) DataTableConvertor.ToDataTable(IEnumerable`1 rows) DataTableConvertor.ToDataTable(Object value) DatabaseCommand.ExecuteInternalCommandAsync[T](Func`1 action) DatabaseCommand.ExecuteTableAsync[T](Func`2 converter)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I'm using the MockTable.FromType method but it crash with a "getter-only" property.
My use case:
The stack trace :
The text was updated successfully, but these errors were encountered: