public void Float_Positive1()
        {
            //arrange
            var fish = new CatFish();

            //act
            var result = fish.Float(new[]{
                new Squama(1, 5) });

            //assert
            Assert.NotNull(result);
        }
        public void Float_Negative2()
        {
            //arrange
            var fish = new CatFish();

            //act
            var result = fish.Float(new Squama[] {
                new Squama( 1, 1 ),
                new Squama( 2, 2 ) });

            //assert
            Assert.Null(result);
        }
Beispiel #3
0
        protected void Find_Click(object sender, EventArgs e)
        {
            Squama[] squamas;
            result.Text = string.Empty;
            var squamasText = setOfSquamas.Text;

            if (string.IsNullOrWhiteSpace(squamasText)
                || !TryParseSquamas(squamasText, out squamas))
            {
                result.Text = ErrorMassage;
                return;
            }

            var fish = new CatFish();
            var resultSet = fish.Float(squamas);

            if (resultSet == null)
            {
                result.Text = SetIncorrectMessage;
                return;
            }
            result.Text = SquamasToString(resultSet);
        }