-
-
Save vkhorikov/1fd737123e10dc60f163d24c95ffb84c to your computer and use it in GitHub Desktop.
You are naming your tests wrong
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MethodUnderTest]_[Scenario]_[ExpectedResult] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delivery_with_a_past_date_is_invalid() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CalculatorTests | |
{ | |
[Fact] | |
public void Sum_of_two_numbers() | |
{ | |
double first = 10; | |
double second = 20; | |
var sut = new Calculator(); | |
double result = sut.Sum(first, second); | |
Assert.Equal(30, result); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Sum_TwoNumbers_ReturnsSum() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Sum_of_two_numbers() | |
public void Sum_TwoNumbers_ReturnsSum() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void IsDeliveryValid_InvalidDate_ReturnsFalse() | |
{ | |
DeliveryService sut = new DeliveryService(); | |
DateTime pastDate = DateTime.Now.AddDays(-1); | |
Delivery delivery = new Delivery | |
{ | |
Date = pastDate | |
}; | |
bool isValid = sut.IsDeliveryValid(delivery); | |
Assert.False(isValid); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delivery_with_invalid_date_should_be_considered_invalid() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delivery_with_past_date_should_be_considered_invalid() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delivery_with_past_date_should_be_invalid() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delivery_with_past_date_is_invalid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment