public void File_IsOwnedBy_returns_true_for_owner() { // Arrange File file = new ExampleFileFactory().CreateFile(); // Act bool isOwnedBy = file.IsOwnedBy(file.Owner); // Assert Assert.True(isOwnedBy); }
public void File_IsOwnedBy_returns_false_for_user_with_different_id_than_owner() { // Arrange File file = new ExampleFileFactory().CreateFile(); var notOwner = new User("f10b5f27-5470-49aa-af83-754dfffa7c2c", "otherUser"); // Act bool isOwnedBy = file.IsOwnedBy(notOwner); // Assert Assert.False(isOwnedBy); }
public void File_IsOwnedBy_returns_true_for_user_with_same_id_as_owner() { // Arrange File file = new ExampleFileFactory().CreateFile(); User fileOwner = file.Owner; var user = new User(fileOwner.Id, fileOwner.Username); // Act bool isOwnedBy = file.IsOwnedBy(user); // Assert Assert.True(isOwnedBy); }