Ejemplo n.º 1
0
        public IHttpActionResult FeedAnimalTuna(FeedAnimalRequest request, string animalId)
        {
            var tuna = new Tuna();

            _feedingService.FeedAnimal(request.AnimalId, tuna);

            return(StatusCode(HttpStatusCode.Accepted));
        }
Ejemplo n.º 2
0
        public static void Serializer_serializes_TwoWay_bindable_type_that_embeds_a_TwoWay_bindable_type_using_specified_serializer()
        {
            var tuna  = new Tuna(SeaCreatureSize.Medium, "black");
            var shark = new Shark("sammy", tuna);

            var expectedSharkJson = Invariant($"{{\r\n  \"name\": \"sammy\",\r\n  \"likesToEat\": {{\r\n    \"color\": \"black\",\r\n    \"size\": \"medium\",\r\n    \"$concreteType\": \"OBeautifulCode.Serialization.Json.Test.JsonSerializationConfigurationTest+Tuna, OBeautifulCode.Serialization.Json.Test\"\r\n  }},\r\n  \"$concreteType\": \"OBeautifulCode.Serialization.Json.Test.JsonSerializationConfigurationTest+Shark, OBeautifulCode.Serialization.Json.Test\"\r\n}}");

            var actualSharkJson = new ObcJsonSerializer(typeof(SeaCreatureJsonSerializationConfiguration).ToJsonSerializationConfigurationType()).SerializeToString(shark);

            actualSharkJson.Should().Be(expectedSharkJson);
        }
Ejemplo n.º 3
0
        public static void Serializer_serializes_TwoWay_bindable_type_that_embeds_a_TwoWay_bindable_type_using_specified_serializer()
        {
            var tuna  = new Tuna(SeaCreatureSize.Medium, "black");
            var shark = new Shark("sammy", tuna);

            var expectedSharkJson = "{\r\n  \"name\": \"sammy\",\r\n  \"likesToEat\": {\r\n    \"color\": \"black\",\r\n    \"size\": \"medium\",\r\n    \"$concreteType\": \"Naos.Serialization.Test.JsonConfigurationTest+Tuna, Naos.Serialization.Test\"\r\n  },\r\n  \"$concreteType\": \"Naos.Serialization.Test.JsonConfigurationTest+Shark, Naos.Serialization.Test\"\r\n}";

            var actualSharkJson = new NaosJsonSerializer(typeof(GenericDiscoveryJsonConfiguration <SeaCreature>)).SerializeToString(shark);

            actualSharkJson.Should().Be(expectedSharkJson);
        }
Ejemplo n.º 4
0
        public void Serializer_serializes_TwoWay_bindable_type_that_embeds_a_TwoWay_bindable_type_using_specified_serializer()
        {
            var tuna  = new Tuna(SeaCreatureSize.Medium, "black");
            var shark = new Shark("sammy", tuna);

            var expectedSharkJson = "{\r\n  \"name\": \"sammy\",\r\n  \"likesToEat\": {\r\n    \"color\": \"black\",\r\n    \"size\": \"medium\",\r\n    \"$concreteType\": \"Spritely.Recipes.Test.JsonConfigurationTest+Tuna, Spritely.Recipes.Test\"\r\n  },\r\n  \"$concreteType\": \"Spritely.Recipes.Test.JsonConfigurationTest+Shark, Spritely.Recipes.Test\"\r\n}";

            var actualSharkJson = JsonConvert.SerializeObject(shark, JsonConfiguration.DefaultSerializerSettings);

            Assert.That(expectedSharkJson, Is.EqualTo(actualSharkJson));
        }
Ejemplo n.º 5
0
    public static void Main(string[] args)
    {
        try
        {
            var fish      = new Tuna();
            var egg       = fish.Lay();
            var smallFish = egg.Hatch();

            var anotherSmallFish = egg.Hatch();
        }
        catch (EggHatchedException ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
Ejemplo n.º 6
0
 private void AddTuna(int number)
 {
     for (int i = 0; i < number; i++)
     {
         while (true)
         {
             byte x = (byte)_random.Next(0, NumCols);
             byte y = (byte)_random.Next(0, NumRows);
             if (_cells[x, y] == null)
             {
                 _cells[x, y] = new Tuna(new Coordinate(x, y));
             }
             else
             {
                 continue;
             }
             break;
         }
     }
 }
Ejemplo n.º 7
0
    public override Species Reproduction(Species species)
    {
        Tuna tuna = new Tuna();

        return(tuna);
    }
Ejemplo n.º 8
0
 static void Main(string[] args)
 {
     var Charlie = new Tuna();
 }