public async Task ReturnEmptyListWhenGivenNull() { // Arrange var record = new Core.Entities.Record(); // Act var result = await recordsService.GetKeywords(record); // Assert Assert.Empty(result); }
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); }
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)); }
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()); }
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()); }
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); }
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); }