public IHttpActionResult FeedAnimalTuna(FeedAnimalRequest request, string animalId) { var tuna = new Tuna(); _feedingService.FeedAnimal(request.AnimalId, tuna); return(StatusCode(HttpStatusCode.Accepted)); }
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); }
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); }
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)); }
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); } }
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; } } }
public override Species Reproduction(Species species) { Tuna tuna = new Tuna(); return(tuna); }
static void Main(string[] args) { var Charlie = new Tuna(); }