コード例 #1
0
        public async Task CharacterViewModel_Update_Valid_Should_Pass()
        {
            // Arrange
            await ViewModel.CreateAsync(new BaseCharacter());

            // Find the First ID
            var first = ViewModel.Dataset.FirstOrDefault();

            // Make a new item
            first.Name  = "New Item";
            first.Level = 1000;

            // Act
            var result = await ViewModel.UpdateAsync(first);

            // Reset

            // Assert
            Assert.AreEqual(true, result);           // Update returned Pas
            Assert.AreEqual("New Item", first.Name); // The Name was updated
            Assert.AreEqual(1000, first.Level);      // The Value was updated
        }