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.
This is not tested.
These two criteria cannot be met together. There must be a priority; either stacking happens first, or adding new items happen first.
(Actually, there are 3 criteria, since
Rarity
andValue
are different: the tiebreaking between these two fields aren't specified either)There are no random tests.
Is the
BodyComponent.IsRemovable
flag even useful? There aren't anywhere forBodyComponent
to keep track of the remaining abount of shots for removing (sinceRequiredShotsForRemoving
is get-only).If
BodyRemovableComponent
can be added/removed fromIMachineAnimal
freely, why isIMachineAnimal.Components
aIReadOnlyCollection<BodyComponent>
?MachineAnimal
's so-called factory pattern ofWithFourLegs
is not even a proper factory pattern: Factory pattern should only create the object after the config operations. Instead it creates the body components by default andWithFourLegs
will replace the entire body components with something else. This is again insane design.Tests should not use
Assert.True
andAssert.False
: it doesn't show what the original expected and actual values are (all they give is "this flag is not expected").What happens if
Bow.ReloadForAttack
is called when there is an ammo already loaded?Resource
is implicitly assumed to be distinguished byName
, but there are nothing in the code that assures this (e.gEquals
andGetHashCode
are not overridden).This applies to every other class as well.
This is an issue
Certain operations have success/failure semantics but are no explained, e.g
Quiver.AddArrows
can fail, but what does it mean by a failure? What happens in this case? Do we not add any arrows, or only add as much as possible?These cases are never explained, and tests never touch them because they only consists of shallow tests of the simplest scenarios.
The kata's OOP design is horrible: it delegates everything and its testing through
Aloy
instead of through the individual objects, which makesAloy
the God object for all hunter-related objects. Many things in these objects are not tested, e.g every single method inQuiver
is not tested because they're only tested throughAloy
's actions.This is why there are many pointless methods in
Aloy
that just delegates to the corresponding methods inBackpack
/Quiver
/etc.Certain designs in the kata that makes no sense. e.g Why
IHunter
doesn't have a backpack if it is a core function of a hunter to have backpack to store things? How does one even expectBackpack
-related methods onIHunter
to work?These are for some reasons implemented onto instances of
IHunter
instead, which makes no sense whatsoever. If anIHunter
is supposed to have a backpack, then it should have this property in the interface. If it doesn't have one, thenAloy
should implement from a separate interfaceIHasBackpack, IArcher
or something that provides said hunter methods of interacting with a backpack.There are a lot of errors in the initial code, such as
And some errors from the sample test code:
Required
using
s in initial code are also missing.I started working on this but quickly ran into issues.
First off, make sure that "Backpack" is spelled correctly throughout your code (you often use "Backpak instead).
Secondly, it is not specified how
Resource
es are distinguished. By their name? Then I'd have to rely on the fact that everyResource
object with the same name has the same properties. This kind of design seems error-prone to me.Overall I think that the kata is perhaps too ambitious in scale. It may be wiser to make it a series (which, judging by the kata name, is what you plan anyway), and just implement a few smaller parts of the interface in this kata, and build in that in future kata.
Loading more items...