public async Task ReturnsNWSOffice() { var content = fac.Get("weatherdata.json"); FactoryMock.Setup(f => f.CreateClient(It.IsAny <string>())) .Returns(GetHttpClient(content)); var stuff = await repository.GetNWSOfficeAsync("41.782", "-80.858"); stuff.Should().NotBeNull().And .BeOfType(typeof(NWSLocation)); }
public async Task ReturnsArrayOfNWSStations() { var content = fac.Get("stations.json"); FactoryMock.Setup(f => f.CreateClient(It.IsAny <string>())) .Returns(GetHttpClient(content)); var stuff = await repository.GetOfficeStations("ILN", "88", "76"); stuff.Should().NotBeNull() .And.HaveCount(c => c > 0); }
private IHost CreateHost() { IFactory factory = new FactoryMock(); IHost host = new HostBaseMock(factory.CreatePlayerManager(6), factory.CreateSpectatorManager(10), factory.CreateBanManager(), factory); host.SetVersion(new Versioning { Major = 1, Minor = 0 }); return(host); }
public void UnitTest01_storeGoodsGreaterThan500WillTriggerSellAction() { //Arrange CallChecker isCalledSell = new CallChecker(); CallChecker isCalledProduce = new CallChecker(); iStoreManagement sellerMock = new SellerMock(isCalledSell, 501); iFactoryManagement factoryMock = new FactoryMock(isCalledProduce); Business testObject = new Business(factoryMock, sellerMock); //Act testObject.runningBusiness(); //Assert Assert.IsTrue(isCalledSell.isCalled); }
public void UnitTest02_storeGoodsLessThan500WillProduceSixTimes() { //Arrange CallChecker isCalledFetchProduct = new CallChecker(); CallChecker isCalledProduce = new CallChecker(); iStoreManagement sellerMock = new SellerMock(isCalledFetchProduct); iFactoryManagement factoryMock = new FactoryMock(isCalledProduce); Business testObject = new Business(factoryMock, sellerMock); //Act testObject.runningBusiness(); //Assert Assert.IsTrue(isCalledFetchProduct.isCalled); Assert.AreEqual(6, ((FactoryMock)factoryMock).produceTime); }