Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You're not supposed to create in instance. The kata only asks that you create a
Type
. The example in the description does not make this 100% clear; the only thing you're supposed to implement isKata.DefineClass()
. If you look closely at the signature of that method, you'll see that the last parameter isref myType
. Theref
modifier should tell you that your method needs to create and assign aType
object to that argument.The author supplies
CreateInstance
and uses it from within the tests (similar to how you are doing it in your code, but you are not supposed to).As for your error messages: they clearly point out where the error is happening:
SomeObject
. You are trying to access these properties fromConsole.WriteLine(...)
. Remove those lines and the error will go away. Not sure why you're trying to get randomly named properties on a type that you just created, without checking whether those properties were even included in the provided dictionary. Also: trying to read a property value of atype
when that property isn't set tostatic
obviously can't work, hence the compiler complains that it needs an instance of that type.Oh, and one more thing: think about when and where you want to create a new Assembly.
Hello everyone,
I keep getting the following errors
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException:
'object' does not contain a definition for 'SomeObject'
System.NullReferenceException:
Object reference not set to an instance of an object.
this is starting to frustrate.
Is there someone who can help me get back on track?
You will find my final code sample in the penultimate post
Thanks.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hey hobovsky,
Thank you for your comment, I thought this was the right direction I should be going to find a solution.
English is not my native language so I must have interpreted it incorrectly and I'm still learning.
Kind regards,
Anne.
Your solution does not exactly realize the task.
You need to create a new type, which will contain requested properties. What you are doing, though, is returning
ExpandoObject
type every time. It's true that instances of this type allow for adding arbitrary properties, but these properties are added to instances, and not to the overall type.Hey,
Is there someone who can answer my question or is this Kata too old to be active.
Thanks in advance.
This comment is hidden because it contains spoiler information about the solution
I keep getting a stacktrace error for my java code. But I know it is right.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Ok guys,
I'm sorry for this question, I was something important forgotten to do.
Kind regards.
This comment is hidden because it contains spoiler information about the solution
Thanks for your tip. I dit not make it dynamic.
Now this kata has been resolved. Not the best way but done.
Still learning.
else if (bitIndex > binValueList.Count)
{
result.Append(binValue.Insert(0, "1"));
}
in this line you add one bit in the beginning of result, But tests can be like this: FlipBit(127,17).In that case you should flip 17th bit of 8bit number, but in your code you flip 9th bit
Loading more items...