示例#1
0
        public async Task ReturnEmptyListWhenGivenNull()
        {
            // Arrange
            var record = new Core.Entities.Record();

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

            // Assert
            Assert.Empty(result);
        }
示例#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);
        }
示例#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));
        }
示例#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());
        }
示例#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());
        }
示例#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);
        }
示例#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);
        }