public void RateItemConstructor_EmptyString_InitedByZero() { // Arrange var expectedNumber = 0; var expectedTextValue = "0 / 0"; // Act RateItem item = new RateItem(""); // Assert Assert.AreEqual(expectedNumber, item.AverageRate); Assert.AreEqual(expectedNumber, item.PeopleVoted); Assert.AreEqual(expectedTextValue, item.ToString()); }
public void RateItemConstructor_StringByTemplate_InitedRight() { // Arrange var expectedRate = 4.26; var expectedCount = 50; var expectedTextValue = $"{expectedRate} / {expectedCount}"; // Act RateItem item = new RateItem(" средняя 4.26, голосов 50"); // Assert Assert.AreEqual(expectedRate, item.AverageRate); Assert.AreEqual(expectedCount, item.PeopleVoted); Assert.AreEqual(expectedTextValue, item.ToString()); }