Skip to content

Bug at C# Code 4, Animal naming #1

Description

@markpackham

Hi I think there's a logic error in the Animal Class when it comes to assigning names.

https://github.com/derekbanas/C-Sharp-Course/blob/main/C%23%20Code%204/Animal.cs#L61

On line 61 there is this validation check for names entered
if (!name.Any(char.IsDigit))

I think the "!" should be removed otherwise the only way to avoid an animal being called "No Name" is by giving the Animal a numerical name.

I'm really enjoying the C# course, thanks for creating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions