public void EditWillReturnCorrectResult(ProductViewModel sut)
 {
     // Fixture setup
     var expectedEditor = sut.AsSource().OfLikeness<ProductEditorViewModel>()
         .With(d => d.Currency).EqualsWhen((s, d) => s.UnitPrice.CurrencyCode == d.Currency)
         .With(d => d.Price).EqualsWhen((s, d) => s.UnitPrice.Amount.ToString("F") == d.Price)
         .Without(d => d.Error)
         .Without(d => d.IsValid)
         .Without(d => d.Title);
     // Exercise system
     ProductEditorViewModel result = sut.Edit();
     // Verify outcome
     Assert.True(expectedEditor.Equals(result));
     // Teardown
 }
Пример #2
0
        public void EditWillReturnCorrectResult(ProductViewModel sut)
        {
            // Fixture setup
            var expectedEditor = sut.AsSource().OfLikeness <ProductEditorViewModel>()
                                 .With(d => d.Currency).EqualsWhen((s, d) => s.UnitPrice.CurrencyCode == d.Currency)
                                 .With(d => d.Price).EqualsWhen((s, d) => s.UnitPrice.Amount.ToString("F") == d.Price)
                                 .Without(d => d.Error)
                                 .Without(d => d.IsValid)
                                 .Without(d => d.Title);
            // Exercise system
            ProductEditorViewModel result = sut.Edit();

            // Verify outcome
            Assert.True(expectedEditor.Equals(result));
            // Teardown
        }