Ad
  • Custom User Avatar

    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 is Kata.DefineClass(). If you look closely at the signature of that method, you'll see that the last parameter is ref myType. The ref modifier should tell you that your method needs to create and assign a Type 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 from Console.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 a type when that property isn't set to static 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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Hey,

    Is there someone who can answer my question or is this Kata too old to be active.

    Thanks in advance.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I keep getting a stacktrace error for my java code. But I know it is right.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Ok guys,

    I'm sorry for this question, I was something important forgotten to do.

    Kind regards.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks for your tip. I dit not make it dynamic.
    Now this kata has been resolved. Not the best way but done.
    Still learning.

  • Custom User Avatar

    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...