public void SetUp() { base.SetUp(); MockUserIdentityProvider.Setup(m => m.SetUserIdentity(It.IsAny <IUserIdentifiable>())).Verifiable(); MockInventoryAdjustmentsService .Setup(m => m.CreateInventoryAdjustment(It.IsAny <ICreateInventoryAdjustmentParameters>())) .Returns(new SuccessResult <string>("123456")); }
public async void ReturnsInventoryAdjustmentDetailsOnSuccess() { // arrange var values = Fixture.Create <InventoryAdjustmentDto>(); var expectedReturn = Fixture.Create <IInventoryAdjustmentReturn>(); MockInventoryAdjustmentsService .Setup(m => m.GetInventoryAdjustment(It.IsAny <string>())) .Returns(new SuccessResult <IInventoryAdjustmentReturn>(expectedReturn)); // act var result = await SystemUnderTest.Post(values); // assert Assert.IsNotNull(result.Content, "The Result's Content was null."); var content = result.Content as ObjectContent <IInventoryAdjustmentReturn>; Assert.IsNotNull(content); Assert.AreEqual(expectedReturn, content.Value); }