Ejemplo n.º 1
0
        public async Task ReturnEmptyListWhenGivenNull()
        {
            // Arrange
            var record = new Core.Entities.Record();

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Empty(result);
        }
Ejemplo n.º 2
0
        public async Task ReturnGoodOutputWhenGivenSmallInput()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Nutritie = "Prea mult colesterol"
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Equal(2, result.ToList().Count);
        }
Ejemplo n.º 3
0
        public async Task ReturnPositiveKeywordsWhenGivenPositiveInput()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Nutritie = "El mananca carne. El mananca legume."
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.All(result, r => Assert.True(r.Positive));
        }
Ejemplo n.º 4
0
        public async Task ReturnGoodOutputWhenGivenOnlyWaist()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Talie = 75
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Empty(result.ToList());
        }
Ejemplo n.º 5
0
        public async Task ReturnGoodOutputWhenGivenVerySmallInput()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Nutritie = "Colesterol"
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Single(result.ToList());
        }
Ejemplo n.º 6
0
        public async Task ReturnGoodOutputWhenGivenComplexRecord()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Greutate       = 80,
                Talie          = 70,
                Nutritie       = "Colesterol",
                StareaGenerala = "Este obosit"
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Equal(2, result.ToList().Count);
        }
Ejemplo n.º 7
0
        public async Task ReturnGoodOutputWhenGivenBigInput()
        {
            // Arrange
            var record = new Core.Entities.Record
            {
                Nutritie = "Persoanele care nu mananca dimineata,"
                           + "nu stiu insa ca pierd nutrienti importanti,"
                           + "cum ar fi fibre si calciu,"
                           + "si ca cei care iau micul dejun sunt cu aproximativ 30 % mai putin expusi obezitatii,"
                           + "au o alimentatie mai sanatoasa,"
                           + "incluzand mai des in dieta fructe si legume."
            };

            // Act
            var result = await recordsService.GetKeywords(record);

            // Assert
            Assert.Equal(12, result.ToList().Count);
        }